PageSourceSearch

https://itemfits.com/_next/static/chunks/81842-92a16f370c0ac637.js

js itemfits.com collected 2026-10-03 23:18:59 UTC 701,856 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81842],{550:(e,t,n)=>{n.d(t,{TG:()=>h,WC:()=>m,j:()=>r,wh:()=>l});var i=n(92970);let a={shelf:"shelves",knife:"knives",half:"halves",leaf:"leaves",wife:"wives",life:"lives",calf:"calves",loaf:"loaves",wolf:"wolves",foot:"feet",tooth:"teeth",child:"children",mouse:"mice",person:"people",man:"men",woman:"women"};function o(e){let t=e.toLowerCase();if(a[t]){let n=a[t];return e[0]===e[0].toUpperCase()?n[0].toUpperCase()+n.slice(1):n}return/[^sx]s$/i.test(t)&&!/ss$/i.test(t)?e:/(?:sh|ch|x|z|ss)$/i.test(e)?e+"es":/[^aeiou]y$/i.test(e)?e.slice(0,-1)+"ies":/fe$/i.test(e)?e.slice(0,-2)+"ves":/[^aeiou]f$/i.test(e)?e.slice(0,-1)+"ves":e+"s"}function r(e){if(!e)return e;let t=e.split(" ");return 1===t.length?o(t[0]):(t[t.length-1]=o(t[t.length-1]),t.join(" "))}function l(e){if(e<=0||e>500)return null;let t=Math.ceil(1.25*e),n=t<=20?5:t<=100?10:25,i=Math.ceil(t/n)*n;return i===e&&(i+=n),i}let s=[{key:"small_bedroom",name:"Small Bedroom",dims:{length_mm:3048,width_mm:3048,height_mm:2438}},{key:"standard_bedroom",name:"Standard Bedroom",dims:{length_mm:3658,width_mm:3048,height_mm:2438}},{key:"large_bedroom",name:"Large Bedroom",dims:{length_mm:4267,width_mm:3658,height_mm:2438}},{key:"garage_1car",name:"1-Car Garage",dims:{length_mm:3658,width_mm:6096,height_mm:3048}},{key:"living_room",name:"Living Room",dims:{length_mm:6096,width_mm:4572,height_mm:2438}},{key:"garage_2car",name:"2-Car Garage",dims:{length_mm:6096,width_mm:6096,height_mm:3048}},{key:"large_living_room",name:"Large Living Room",dims:{length_mm:7620,width_mm:6096,height_mm:2438}}],m=[{key:"briefcase",name:"Briefcase",dims:{length_mm:457,width_mm:330,height_mm:127}},{key:"backpack",name:"Backpack",dims:{length_mm:508,width_mm:305,height_mm:203}},{key:"carry_on",name:"Carry-On",dims:{length_mm:559,width_mm:356,height_mm:229}},{key:"shelf_small",name:"Small Shelf",dims:{length_mm:610,width_mm:305,height_mm:305}},{key:"duffel",name:"Duffel Bag",dims:{length_mm:762,width_mm:356,height_mm:356}},{key:"suitcase",name:"Suitcase",dims:{length_mm:711,width_mm:508,height_mm:305}},{key:"large_suitcase",name:"Large Suitcase",dims:{length_mm:813,width_mm:559,height_mm:356}},{key:"shelf_wide",name:"Wide Shelf",dims:{length_mm:1219,width_mm:305,height_mm:305}},{key:"bookcase",name:"Bookcase",dims:{length_mm:914,width_mm:305,height_mm:1829}}];function c(e){return e.length_mm*e.width_mm}function d(e){let t=e.length_mm,n=e.width_mm;return t>=n?t/n:n/t}function h(e,t,n){let a="room"===e?s:"container"===e?m:"vehicle"===e?[...(0,i.getCandidateSpaces)("vehicle"),...(0,i.getCandidateSpaces)("storage"),...(0,i.getCandidateSpaces)("container")].map(e=>({key:e.id,name:e.name,dims:{length_mm:Math.round(25.4*e.floor_length_in),width_mm:Math.round(25.4*e.floor_width_in),height_mm:Math.round(25.4*e.interior_height_in)}})).sort((e,t)=>e.dims.length_mm*e.dims.width_mm*e.dims.height_mm-t.dims.length_mm*t.dims.width_mm*t.dims.height_mm):s;if(!a||0===a.length)return null;let o=n.recommendedCount<=3?"larger":n.floorCoveragePercent<30?"smaller":(n.floorCoveragePercent,"larger"),r=0,l=1/0;for(let e=0;e<a.length;e++){let n=function(e,t){let n=c(e);return .7*(Math.abs(c(t)-n)/n)+.3*Math.abs(d(t)-d(e))}(t,a[e].dims);n<l&&(l=n,r=e)}let h="larger"===o?r+1:r-1;if(h>=0&&h<a.length){let e=a[h],n=c(t);if(Math.abs(c(e.dims)-n)/n>=.1)return{name:e.name,dims:e.dims};let i="larger"===o?h+1:h-1;if(i>=0&&i<a.length)return{name:a[i].name,dims:a[i].dims}}let u="larger"===o?r-1:r+1;if(u>=0&&u<a.length){let e=a[u],n=c(t);if(Math.abs(c(e.dims)-n)/n>=.1)return{name:e.name,dims:e.dims}}return null}},3732:(e,t,n)=>{n.d(t,{bD:()=>r});let i={refrigerator:{stackable:!0,upright_only:!1,max_stack:3,weight_lbs:250,weight_capacity_lbs:400,reason:"Steel shell, strong top surface"},washer:{stackable:!0,upright_only:!1,max_stack:3,weight_lbs:170,weight_capacity_lbs:350,reason:"Steel drum housing, strong structure"},dryer:{stackable:!0,upright_only:!1,max_stack:3,weight_lbs:130,weight_capacity_lbs:300,reason:"Steel shell, commonly stacked on washers"},dishwasher:{stackable:!0,upright_only:!1,max_stack:3,weight_lbs:80,weight_capacity_lbs:250,reason:"Compact steel frame"},range:{stackable:!0,upright_only:!1,max_stack:3,weight_lbs:150,weight_capacity_lbs:300,reason:"Flat steel top, strong frame"},oven:{stackable:!0,upright_only:!1,max_stack:2,weight_lbs:150,weight_capacity_lbs:200,reason:"Steel housing, glass door is fragile but structurally sound"},microwave:{stackable:!0,upright_only:!1,max_stack:4,weight_lbs:35,weight_capacity_lbs:150,reason:"Light and boxy"},mattress:{stackable:!1,vertical_only:!0,max_stack:1,weight_lbs:80,weight_capacity_lbs:0,reason:"Deformable surface, cannot support weight"},sofa:{stackable:!1,rotate_allowed:!0,max_stack:1,weight_lbs:200,weight_capacity_lbs:50,reason:"Cushioned/irregular surface"},loveseat:{stackable:!1,rotate_allowed:!0,max_stack:1,weight_lbs:130,weight_capacity_lbs:50,reason:"Cushioned/irregular surface"},table:{stackable:!0,upside_down_preferred:!0,max_stack:2,weight_lbs:100,weight_capacity_lbs:200,reason:"Flat surface when inverted"},chair:{stackable:!0,max_stack:4,weight_lbs:25,weight_capacity_lbs:100,reason:"Can nest/stack"},dresser:{stackable:!0,upright_only:!1,max_stack:2,weight_lbs:120,weight_capacity_lbs:200,reason:"Flat top, solid wood/MDF"},bookshelf:{stackable:!0,upright_only:!1,max_stack:2,weight_lbs:80,weight_capacity_lbs:150,reason:"Flat surfaces, rigid frame"},desk:{stackable:!0,max_stack:2,weight_lbs:80,weight_capacity_lbs:150,reason:"Flat surface"},bed_frame:{stackable:!0,vertical_only:!0,max_stack:2,weight_lbs:60,weight_capacity_lbs:100,reason:"Flat rigid frame"},pillow:{stackable:!0,max_stack:10,weight_lbs:2,weight_capacity_lbs:20,reason:"Light and compressible, stacks easily"},blanket:{stackable:!0,max_stack:8,weight_lbs:5,weight_capacity_lbs:30,reason:"Folds flat, stacks easily"},towel:{stackable:!0,max_stack:12,weight_lbs:1,weight_capacity_lbs:25,reason:"Folds flat, very stackable"},clothing:{stackable:!0,max_stack:999,weight_lbs:1,weight_capacity_lbs:50,reason:"Folds flat, no height limit"},box_small:{stackable:!0,max_stack:6,weight_lbs:30,weight_capacity_lbs:120},box_medium:{stackable:!0,max_stack:5,weight_lbs:45,weight_capacity_lbs:150},box_large:{stackable:!0,max_stack:4,weight_lbs:60,weight_capacity_lbs:180}},a={refrigerator:{max_stack:1,reason:"Compressor oil migration, must stay upright"},washer:{max_stack:1,reason:"Drum suspension damage risk"},dryer:{max_stack:1,reason:"Commonly paired with washer, kept upright"},range:{max_stack:1,reason:"Glass cooktop / control panel damage risk"},oven:{max_stack:1,reason:"Glass door, heavy and fragile"},mattress:{max_stack:1},sofa:{max_stack:1},table:{max_stack:1,reason:"Legs break under asymmetric stacking"},dishwasher:{max_stack:2},microwave:{max_stack:4},chair:{max_stack:3},box_small:{max_stack:4},box_medium:{max_stack:3},box_large:{max_stack:3}},o={fridge:"refrigerator",freezer:"refrigerator",stove:"range",cooktop:"range",couch:"sofa",sectional:"sofa",wardrobe:"dresser",armoire:"dresser",nightstand:"table","end table":"table","coffee table":"table","dining table":"table","kitchen table":"table",recliner:"sofa","office chair":"chair","bar stool":"chair","twin mattress":"mattress","queen mattress":"mattress","king mattress":"mattress","box spring":"mattress",cushion:"pillow","throw pillow":"pillow","bed pillow":"pillow",comforter:"blanket",duvet:"blanket",quilt
1:"blanket",shirt:"clothing",shirts:"clothing",pants:"clothing",jeans:"clothing",jacket:"clothing",coat:"clothing",sweater:"clothing",hoodie:"clothing",book:"box_small",books:"box_small","small box":"box_small","small moving box":"box_small","book box":"box_small","medium box":"box_medium","medium moving box":"box_medium","moving box":"box_medium","large box":"box_large","large moving box":"box_large","wardrobe box":"box_large",carton:"box_medium","bed frame":"bed_frame","bed frames":"bed_frame",bookcase:"bookshelf",bookcases:"bookshelf","book case":"bookshelf","book shelf":"bookshelf"};function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"theoretical",n=e.toLowerCase().trim(),a=Object.keys(o).sort((e,t)=>t.length-e.length).find(e=>n.includes(e));if(a){let e=o[a];return l({...i[e],category:e},t)}let r=Object.keys(i).sort((e,t)=>t.length-e.length).find(e=>n.includes(e));return r?l({...i[r],category:r},t):null}function l(e,t){if("logistics"===t&&e){let t=a[e.category];if(t)return{...e,...t,_logisticsOverride:!0}}return e}},5979:(e,t,n)=>{n.d(t,{H:()=>l});var i=n(58271),a=n(21430),o=n(85850),r=n(95704);function l(e,t){let n=function(){let e=String(void 0!==r&&r.env.TEMPLATE_SOLVER_PROOF||"off").toLowerCase();return"shadow"===e||"live"===e?e:"off"}();if(!t||"off"===n)return t;try{let r=function(e,t){let n,r=function(e,t){var n,i,a;switch(e){case"residual":return null!=(n=null==t?void 0:t.verdict)?n:null;case"arrangement":if((null==t?void 0:t.feasible)===!0)return"FITS";if((null==t?void 0:t.feasible)===!1)return"DOESNT_FIT";return null;case"optimization":if(null==t?void 0:t.noFeasibleStrategy)return"DOESNT_FIT";return(null==t||null==(i=t.strategies)?void 0:i.length)?"FITS":null;case"comparison":if(null==t?void 0:t.tooMany)return null;if(null==t?void 0:t.allFit)return"FITS";if(null==t?void 0:t.allFail)return"DOESNT_FIT";return(null==t||null==(a=t.scenarioResults)?void 0:a.length)?"FITS":null;default:return null}}(e,t);if(null==(0,o.cc)(r))return[];switch(e){case"residual":n=function(e){let t=null==e?void 0:e.residual,n=null==t?void 0:t.volume_mm3;if(null==n)return[];let i=null==t?void 0:t.usedVolume_mm3,a=(null!=i?i:0)+n;return[{id:"residual_volume",limiting:!0,passed:"HAS_SPACE"===e.verdict,comparison:{actual_mm:null,limit_mm:null,margin_mm:Math.round(n)},values:{space_vol_mm3:Math.round(a),occupied_vol_mm3:Math.round(null!=i?i:a-n),residual_vol_mm3:Math.round(n)}}]}(t);break;case"arrangement":var l;l=t,n=(null==l?void 0:l.utilization)==null?[]:[{id:"utilization_ratio",passed:!1!==l.feasible,values:{utilization_pct:Math.round(100*l.utilization)}}];break;case"optimization":n=function(e){var t,n;let i=null==e||null==(t=e.strategies)?void 0:t[0];return i?[{id:"strategy_score",passed:!1!==i.feasible,values:{strategy_label:i.label||"Best arrangement",rank:1,score:Math.round((null!=(n=i.utilization)?n:0)*100)}}]:[]}(t);break;case"comparison":n=function(e){var t,n,i;let a=(null==e?void 0:e.scenarioResults)||[];if(!a.length)return[];let o=null!=(n=null==e||null==(t=e.winner)?void 0:t.scenarioIndex)?n:0,r=a[o]||a[0];return[{id:"scenario_ranking",passed:!!(null==r?void 0:r.isFit),values:{scenario_label:(null==r?void 0:r.scenarioName)||"Scenario ".concat(o+1),fits:!!(null==r?void 0:r.isFit),margin_mm:null!=(i=null==r?void 0:r.margin_mm)?i:null}}]}(t);break;default:return[]}return Array.isArray(n)&&n.length?function(e,t){let{verdict:n,family:r}=t;try{let{ok:t}=(0,o.XX)(e,{registry:a.g8,verdict:n,family:r,requireDiagram:!1});try{i.U.log("[TEMPLATE-PROOF-SHADOW]",JSON.stringify({family:r,verdict:n,assertPass:t,step_count:e.length,limitingPolicy:e.some(e=>e.limiting)?"has-limiting":"none"}))}catch(e){}return t?e:[]}catch(e){try{i.U.warn("[TEMPLATE-PROOF-SHADOW] assert threw",null==e?void 0:e.message)}catch(e){}return[]}}(n,{verdict:r,family:e}):[]}(e,t);r.length&&"live"===n&&(t.proofSteps=r)}catch(e){}return t}},6063:(e,t,n)=>{n.d(t,{S:()=>i});function i(e){return e.toLowerCase().trim().replace(/\s+/g," ").replace(/[^\w\s-]/g,"")}},7199:(e,t,n)=>{n.d(t,{Gt:()=>o,OP:()=>i,XL:()=>a});let i="stair_resolve_outcome";function a(e){try{if(!e||"object"!=typeof e)return 0;return Object.keys(e).filter(e=>"unit"!==e).length}catch(e){return 0}}function o(e){try{var t,n,i,a,o,r;if(!e)return"failed_network";let l=null!=(r=null!=(o=null!=(a=e.status)?a:e.statusCode)?o:null==(t=e.response)?void 0:t.status)?r:null;if(402===l||(null==(n=e.responseBody)?void 0:n.insufficientTokens)===!0||!0===e.insufficientTokens)return"failed_insufficient_tokens";if(403===e.status&&(null==(i=e.responseBody)?void 0:i.requiresAuth))return"failed_free_query_limit";if("number"==typeof l&&l>=400)return"failed_http";return"failed_network"}catch(e){return"failed_network"}}Object.freeze(Object.freeze(["skipped_no_pending_message","skipped_no_patcher","failed_free_query_limit","failed_insufficient_tokens","failed_http","failed_network","degraded_empty_response","fallback_cached_response","superseded","resolved","resolved_non_verdict"]).filter(e=>"resolved"!==e))}
1,8054:(e,t,n)=>{n.d(t,{Ay:()=>x});var i=n(95155),a=n(12115),o=n(98934),r=n(96744);let l={door:["Try it up the stairs","Check car fit","Check the hallway"],hallway:["Check the doorway","Try it up the stairs","Check car fit"],stairs:["Check the doorway","Check car fit","Check the hallway"],elevator:["Check the doorway","Try it up the stairs","Check car fit"],vehicle:["Check the doorway","Try it up the stairs","Check the hallway"],room:["Check the doorway","Try it up the stairs","Check car fit"],"multi-item":["Check the doorway","Try it up the stairs","Check car fit"],container:["Check the doorway","Try it up the stairs","Check car fit"],"batch-door":["Try it up the stairs","Check car fit","Check the hallway"],"batch-vehicle":["Check the doorway","Try it up the stairs","Check the hallway"],"batch-stairs":["Check the doorway","Check car fit","Check the hallway"]};function s(e){return l[e]||l.door}let m={"Check the doorway":"Doorway","Check the hallway":"Hallway","Try it up the stairs":"Stairs","Check car fit":"Car"},c=e=>m[e]||e,d={"Check the doorway":"doorway","Check the hallway":"hallway","Try it up the stairs":"stairs","Check car fit":"vehicle"};function h(e,t){let{fitCheckId:n,itemName:i,itemDims:a,isMultiItem:o}=t;if(o||!n||!i||!a)return null;let r=Math.round(25.4*Number(a.width)),l=Math.round(25.4*Number(a.depth)),s=Math.round(25.4*Number(a.height));return[r,l,s].every(e=>Number.isFinite(e)&&e>0)?{parentFitCheckId:n,item:{name:i,dims_mm:{w:r,d:l,h:s}},originChip:"cross_space:".concat(d[e]||"space")}:null}let u={door:"What if the door is wider?",doorway:"What if the doorway is wider?",passage:"What if the doorway is wider?",hybrid:"What if the doorway is wider?",hallway:"What if the hallway is wider?",stairs:"What if the stairway is wider?",elevator:"What if the elevator is bigger?",vehicle:"What if I use a bigger vehicle?",room:"What if the room is bigger?","multi-item":"What if the room is bigger?",container:"What if the container is bigger?",window:"What if the window is bigger?","batch-door":"What if the door is wider?","batch-vehicle":"What if I use a bigger vehicle?","batch-stairs":"What if the stairway is wider?"},_={door:"What if the door is narrower?",doorway:"What if the doorway is narrower?",passage:"What if the doorway is narrower?",hybrid:"What if the doorway is narrower?",hallway:"What if the hallway is narrower?",stairs:"What if the stairway is narrower?",elevator:"What if the elevator is smaller?",vehicle:"What if I use a smaller vehicle?",room:"What if the room is smaller?","multi-item":"What if the room is smaller?",container:"What if the container is smaller?",window:"What if the window is smaller?","batch-door":"What if the door is narrower?","batch-vehicle":"What if I use a smaller vehicle?","batch-stairs":"What if the stairway is narrower?"};function g(e,t,n){if(!e)return null;if("room"===t||"container"===t||"multi-item"===t){let t=Math.round(e/12),i=n?Math.round(n/12):t;return t===i?"".concat(t,"'\xd7").concat(i,"'"):"".concat(i,"'\xd7").concat(t,"'")}return"".concat(e,'"')}let p={door:"door",doorway:"doorway",hallway:"hallway",stairs:"stairway",elevator:"elevator",vehicle:"vehicle",room:"room","multi-item":"room",container:"container",window:"window","batch-door":"door","batch-vehicle":"vehicle","batch-stairs":"stairway"},f={width:"wide",depth:"deep",height:"tall"},w=new Set(["door","doorway","passage","hybrid","hallway","elevator","window","batch-door"]),v=new Set(["door","doorway","passage","hybrid","batch-door"]),b=new Set(["hallway","elevator","window"]),y=new Set(["vehicle","batch-vehicle"]),T=new Set(["DOESNT_FIT","LIKELY_DOESNT_FIT"]),I=new Set(["FITS_TIGHT","FITS_VERY_TIGHT","FITS_TILTED","FITS_ROTATED","FITS_COMPRESSED","FITS_WONT_CLOSE","FITS_DISASSEMBLED","TIGHT"]);function M(e){let{dims:t,itemName:n,grow:i}=e,a=function(e){if(!e||"object"!=typeof e)return null;let t=[["width",e.width],["depth","number"==typeof e.depth?e.depth:e.length],["height",e.height]].filter(e=>{let[,t]=e;return"number"==typeof t&&t>0});return t.length?t.reduce((e,t)=>t[1]>e[1]?t:e):null}(t);if(!a)return null;let[o,r]=a,l=f[o]||"wide",s=i?2*Math.ceil(1.1*r/2):Math.max(2,2*Math.floor(.9*r/2));return(i?s<=Math.round(r):s>=Math.round(r))?null:{key:i?"grow_item":"shrink_item",lever:i?"grow_item":"shrink_item",label:i?"Try a bigger one":"What if it were ".concat(s,"″ ").concat(l,"?"),query:"What if my ".concat(n," ").concat(i?"were":"were only"," ").concat(s,'" ').concat(l," instead?")}}function S(e){let{children:t}=e,[n,o]=(0,a.useState)(!1),[r,l]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=window.matchMedia("(max-width: 639px)");o(e.matches);let t=e=>{o(e.matches),l(0)};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let s=a.Children.toArray(t);if(!n)return(0,i.jsx)("div",{className:"flex flex-wrap justify-center",style:{gap:6},children:t});let m=Math.ceil(s.length/2),c=2*r,d=s.slice(c,c+2),h=r>0,u=r<m-1;return(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 w-full",children:[(0,i.jsx)("button",{onClick:()=>h&&l(e=>e-1),className:"flex-shrink-0 w-6 h-6 flex items-center justify-center rounded-full transition-colors ".concat(h?"text-slate-500 hover:bg-slate-100":"text-slate-200"),"aria-label":"Previous chips",disabled:!h,children:(0,i.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,i.jsx)("div",{className:"flex flex-1 justify-center gap-1.5",children:d}),(0,i.jsx)("button",{onClick:()=>u&&l(e=>e+1),className:"flex-shrink-0 w-6 h-6 flex items-center justify-center rounded-full transition-colors ".concat(u?"text-slate-500 hover:bg-slate-100":"text-slate-200"),"aria-label":"Next chips",disabled:!u,children:(0,i.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"M9 18l6-6-6-6"})})})]}),m>1&&(0,i.jsx)("div",{className:"flex gap-1",children:Array.from({length:m},(e,t)=>(0,i.jsx)("button",{onClick:()=>l(t),className:"rounded-full transition-all duration-200 ".concat(t===r?"w-4 h-1.5 bg-slate-400":"w-1.5 h-1.5 bg-slate-200"),"aria-label":"Page ".concat(t+1)},t))})]})}function k(e){let{label:t,mobileLabel:n,isPrimary:a,onClick:o,disabled:r}=e;return(0,i.jsx)("button",{onClick:r?void 0:o,disabled:r,className:"transition-all duration-150 whitespace-nowrap px-2.5 py-1.5 rounded-full text-[11px] font-medium flex items-center justify-center border ".concat(r?"opacity-40 cursor-not-allowed text-gray-400":a?"text-white hover:opacity-90":"bg-white text-[#64748b] hover:text-[#1E3A8A] hover:border-[rgba(30,58,138,0.3)]"),style:r?{}:a?{backgroundColor:"#1E3A8A",borderColor:"#1E3A8A"}:{borderColor:"#e2e8f0"},children:n&&n!==t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"sm:hidden",children:n}),(0,i.jsx)("span",{className:"hidden sm:inline",children:t})]}):t})}function N(e){let{fitCheckId:t,labels:n,verdict:i,queryType:r}=e,l=(0,a.useRef)(new Set),s=(n||[]).join("|");return(0,a.useEffect)(()=>{for(let e of n||[]){if(!e)continue;let n="chip_shown:".concat(null!=t?t:"nofc",":").concat(e);l.current.has(n)||(l.current.add(n),(0,o.Rg)({eventType:"chip_shown",verdict:i,queryType:r,fitCheckId:t,metadata:{chip_label:e,idempotency_key:n},sourceComponent:"ActionChips"}))}},[t,s,i,r]),null}let x=a.memo(function(e){let{verdict:t,queryType:n,fitCheckId:l,itemType:m,itemName:d,itemDims:f,isTurnFreeStairs:x,activeHandrailCount:E,isMultiItem:D,isFlipped:F,spaceDimension:C,alternateDimension:O,alternateDimensionLength:R,onManeuverPath:A,onLiveEdit:L,onSubmitQuery:P,showManeuver:U,liveEditDisabled:H,capacityChips:W,disabled:G,hideLiveEdit:q,hideCrossSpace:j,seatConstraint:z,assumedGeneration:V,vehiclePreFilter:B,onReopenVehicleGrid:Y,isComparison:K=!1,onCompareAnother:$,compareAnotherL
1abel:X="Compare another car"}=e,[Q,J]=(0,a.useState)(0),[Z,ee]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{var e,t,n;ee(!!(null==(t=(n=window).matchMedia)||null==(e=t.call(n,"(prefers-reduced-motion: reduce)"))?void 0:e.matches)),J(0);let i=0,a=null,o=()=>{J(i+=1),i>=9&&a&&(clearInterval(a),a=null)},r=setTimeout(()=>{o(),a=setInterval(o,500)},150);return()=>{clearTimeout(r),a&&clearInterval(a)}},[l,t,n]),W&&W.length>0){let e=W.find(e=>"live-edit"===e.type),a=W.filter(e=>"conversational"===e.type),s=[...e?[e.label]:[],...a.map(e=>e.label)];return(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsx)(N,{fitCheckId:l,labels:s,verdict:t,queryType:n}),(0,i.jsxs)(S,{children:[e&&(0,i.jsx)("button",{onClick:()=>{(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"capacity_live_edit",chip_label:e.label},sourceComponent:"ActionChips"}),null==L||L(e.dims,e.spaceName)},disabled:H,className:"px-3 py-1.5 rounded-full text-xs font-medium transition-colors bg-blue-50 text-blue-700 hover:bg-blue-100 border border-blue-200 disabled:opacity-40",children:e.label}),a.map((e,a)=>(0,i.jsx)("button",{onClick:()=>{let i=(0,r.yz)({chip_label:e.label,parentFitCheckId:l,chip_category:"capacity_conversational",parentVerdict:t});(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"capacity_conversational",chip_label:e.label,chip_query:e.query,chip_click_id:i},sourceComponent:"ActionChips"}),null==P||P(e.query)},className:"px-3 py-1.5 rounded-full text-xs font-medium transition-colors bg-slate-50 text-slate-600 hover:bg-slate-100 border border-slate-200",children:e.label},a))]})]})}if(G){let[e,t]=s(n);return(0,i.jsx)("div",{style:{opacity:.4,pointerEvents:"none"},children:(0,i.jsx)("div",{className:"flex flex-nowrap justify-center items-center gap-1.5 px-2",children:[e,t].map(e=>(0,i.jsx)(k,{label:c(e),disabled:!0},e))})})}let et=function(e,t,n,i,a,o){if(o&&i){let e=g(i,n,a);if(e){let t=p[n]||"space";return"Back to ".concat(e," ").concat(t)}}if(o){let e=p[n]||"space";return"Back to original ".concat(e)}if(i){let e=g(i,n,a);if(e){let t=p[n]||"space";return"Try ".concat(e," ").concat(t," instead")}}return e?_[n]||"What if it's narrower?":t?"Try ".concat(t," instead"):u[n]||"What if the space is bigger?"}("FITS"===t||"FITS_TIGHT"===t||"FITS_VERY_TIGHT"===t||"FITS_WONT_CLOSE"===t||"FITS_ROTATED"===t||"FITS_STRAIGHT"===t||"FITS_TILTED"===t||"LIKELY_FITS"===t,C,n,O,R,F),en=()=>{(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"live_edit",chip_label:et,item_name:d},sourceComponent:"ActionChips"}),L&&L()},[ei,ea]=s(n),eo=(e,a)=>(0,i.jsx)(k,{label:a||e,mobileLabel:a?void 0:c(e),onClick:()=>{let i=function(e,t,n){if(n)return({"Check car fit":"Will my items fit in my car?","Check the doorway":"Will my items fit through the doorway?","Try it up the stairs":"Will my items fit up the stairs?","Check the hallway":"Will my items fit through the hallway?"})[e]||e;let i=t||"item";return({"Check car fit":"Will my ".concat(i," fit in my car?"),"Check the doorway":"Will my ".concat(i," fit through the doorway?"),"Try it up the stairs":"Will my ".concat(i," fit up the stairs?"),"Check the hallway":"Will my ".concat(i," fit through the hallway?")})[e]||e}(e,d,D),a=(0,r.yz)({chip_label:e,parentFitCheckId:l,chip_category:"cross_space",parentVerdict:t});(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"cross_space",chip_label:e,chip_query:i,is_multi_item:D,chip_click_id:a},sourceComponent:"ActionChips"});let s=h(e,{fitCheckId:l,itemName:d,itemDims:f,isMultiItem:D});s&&(0,r.$M)(s),null==P||P(i)}},e),er=d||"it",el=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(0,i.jsx)(k,{label:e.label,isPrimary:a,onClick:()=>{var i;let a=(0,r.yz)({chip_label:e.label,parentFitCheckId:l,chip_category:"verdict_action",chip_lever:null!=(i=e.lever)?i:null,parentVerdict:t});(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"verdict_action",chip_lever:e.lever,chip_label:e.label,chip_query:e.query,item_name:d,chip_click_id:a},sourceComponent:"ActionChips"}),null==P||P(e.query)}},e.key)},es=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(0,i.jsx)(k,{label:e.label,isPrimary:a,onClick:()=>{var i;let a=(0,r.yz)({chip_label:e.label,parentFitCheckId:l,chip_category:"verdict_action",chip_lever:null!=(i=e.lever)?i:null,parentVerdict:t});(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"verdict_action",chip_lever:e.lever,chip_label:e.label,chip_query:e.query,item_name:d,chip_click_id:a},sourceComponent:"ActionChips"});let s=h("Try it up the stairs",{fitCheckId:l,itemName:d,itemDims:f,isMultiItem:D});s&&(0,r.$M)(s),null==P||P(e.query)}},e.key)},em=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,i.jsx)(k,{label:"Try it on the diagonal",isPrimary:e,onClick:()=>{(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"maneuver_action",chip_lever:"tilt",chip_label:"Try it on the diagonal",item_name:d},sourceComponent:"ActionChips"}),null==A||A()}},"tilt")},ec=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,i.jsx)(k,{label:function(e){if(!e)return e;let t=e=>e.charAt(0).toUpperCase()+e.slice(1),n=e.match(/^what if the (.+?) is (wider|narrower|bigger|smaller)\?$/i);return n?"".concat(t(n[2])," ").concat(n[1],"?"):(n=e.match(/^what if i use a (bigger|smaller) (.+?)\?$/i))?"".concat(t(n[1])," ").concat(n[2],"?"):/^what if it's (wider|narrower|bigger|smaller)\?$/i.test(e)?t(e.replace(/^what if it's /i,"").replace(/\?$/,""))+"?":/^what if the space is bigger\?$/i.test(e)?"Bigger space?":e}(et),isPrimary:e,onClick:en,disabled:H},"liveedit")},ed=K?null:M({dims:f,itemName:er,grow:!1}),eh=K?null:M({dims:f,itemName:er,grow:!0}),eu={key:"disassemble",lever:"disassemble",label:"Could it come apart?",query:"Will my ".concat(er," fit if I take it apart — e.g. remove the legs or feet?")},e_={key:"fold_seats",lever:"fold_seats",label:"Fold the seats down?",query:"Will my ".concat(er," fit with the rear seats folded down?")},eg=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,i.jsx)(k,{label:"Different year?",isPrimary:e,onClick:()=>{(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"vehicle_edit",chip_lever:"change_year",chip_label:"Different year?",item_name:d},sourceComponent:"ActionChips"}),null==Y||Y(B||null)}},"change_year")},ep={key:"no_door",lever:"constraint",label:"Without the door on?",query:"Will my ".concat(er," fit through the doorway with the door taken off?")},ef={key:"no_handrails",lever:"constraint",label:"No handrails?",query:"Will my ".concat(er," fit up the stairs with no handrails?")},ew={key:"straight_stairs",lever:"constraint",label:"Straight stairs?",query:"Will my ".concat(er," fit up straight stairs with no turns?")},ev=q||K,eb=T.has(t)?"doesnt_fit":I.has(t)?"tight":"fits",ey=w.has(n),eT=v.has(n),eI="stairs"===n||"batch-stairs"===n,eM=[];"doesnt_fit"===eb?(ey&&eM.push(e=>em(e)),eI?(0!==E&&eM.push(e=>es(ef,e)),ev||eM.push(e=>ec(e)),x?j||eM.push(()=>eo(ei)):eM.push(e=>es(ew,e))):eT?(ed&&eM.push(e=>el(ed,e)),eM.push(e=>el(ep,e)),ev||eM.push(e=>ec(e))):(ed&&eM.push(e=>el(ed,e)),ev||eM.push(e=>ec(e)),b.has(n)?eM.push(e=>el(eu,e)):!j&&(eM.push(()=>eo(ei)),ed||eM.push(()=>eo(ea))))):"tight"===eb?(eT&&eM.push(e=>el(ep,e)),ey&&eM.push(e=>em(e)),j||(eM.push(()=>eo(ei)),eM.push(()=>eo(ea)))):(j||(eM.push(()=>eo(ei)),eM.push(()=>eo(ea))),eh?eM.push(e=>el(eh,e)):ev||eM.push(e=>ec(e))),y.has(n)&&("up"===z&&("doesnt_fit"===eb||"tight"===eb)&&eM.unshift(e=>el(e_,e)),V&&eM.splice(+!!eM.length,0,()=>eg())),K&&$&&eM.push(()=>(0,i.jsx)(k,{label:X,onClick:()=>{(0,o.Rg)({eventType:"chip_click",verdict:t,queryType:n,fitCheckId:l,metadata:{chip_category:"comparison_edit",chip_lever:"compare_another",chip_label:X,item_name:d},sourceComponent:"ActionChips"}),null==$||$()}},"compare_another"));let eS=eM.slice(0,4).map((e,t)=>
1e(0===t)).filter(Boolean);eS.length||(eS=[!ev&&ec(!0),!j&&eo(ei),!j&&eo(ea)].filter(Boolean));let ek=eS.map(e=>{var t;return null==e||null==(t=e.props)?void 0:t.label}).filter(Boolean);return(0,i.jsxs)("div",{className:"mt-1",children:[(0,i.jsx)(N,{fitCheckId:l,labels:ek,verdict:t,queryType:n}),(0,i.jsx)(S,{children:eS})]})})},14951:(e,t,n)=>{n.d(t,{X:()=>r});var i=n(81143);let a={FITS:"**FITS** ✓",TIGHT_FIT:"**TIGHT FIT** ⚠",DOESNT_FIT:"**DOESN'T FIT** ✕",LIKELY_FITS:"**LIKELY FITS** ✓",LIKELY_DOESNT_FIT:"**LIKELY DOESN'T FIT** ✕"},o=new Set(["soft_compress","payload_warning","door_check_skipped","aggregate_boxes"]);function r(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";if(!(0,i.jq)(e.verdict)&&!(0,i.AO)(e.verdict))return e.message||"I need the missing measurements before I can check the load.";let{includeVerdictHeader:l=!0}=r,s=[],m=e.spaceUsed||{},c=m.brand_canonical?"".concat(m.brand_canonical," "):"",d=m.name||"the container",h=Number.isFinite(e.packingDensity)&&e.packingDensity>=0?Math.round(100*e.packingDensity):null,u=Array.isArray(e.itemBreakdown)?e.itemBreakdown:[],_=u.reduce((e,t)=>e+(Number.isFinite(t.qty)?t.qty:1),0),g=u.some(e=>"inferred"===e.qtySource&&(Number.isFinite(e.qty)?e.qty:1)>1),p="".concat(g?"~":"").concat(_),f=e.verdict||"UNKNOWN",w=(0,i.jq)(f);l&&(s.push(a[f]?a[f]:(0,i.AO)(f)?a.DOESNT_FIT:(0,i.jq)(f)?a.FITS:"**RESULT** —"),s.push(""));let v=m.dims||{},b=Number.isFinite(v.width_in)?Math.round(v.width_in):null,y=Number.isFinite(v.length_in)?Math.round(v.length_in):null,T=Number.isFinite(v.height_in)?Math.round(v.height_in):null,I=(e.assumptions||[]).some(e=>e&&"object"==typeof e&&"door_check_skipped"===e.kind),M=Number.isFinite(m.doorWidth_in)&&Number.isFinite(m.doorHeight_in),S="stacking_required"===e.limiting_constraint,k=u.some(e=>{var t;return/\bbox|carton\b/i.test(String(null!=(t=null==e?void 0:e.name)?t:""))});if(_>0){if(w){let e="Your ".concat(p," items fit in a ").concat(c).concat(d);e+=S?" — but only stacked.":".",s.push(e),null!=h&&s.push(S?"They come to about ".concat(h,"% of its cubic space, so volume is not what is tight — the floor is."):"They come to about ".concat(h,"% of its cubic space.")),S||s.push("We checked the combined cubic volume, floor footprint, row packing, and every item's height; none of those checks is at its limit."),S&&s.push(b&&y?"Laid out in a single layer the footprint overruns the ".concat(b," \xd7 ").concat(y," in deck, so we re-checked it with like items stacked; that is what closes the gap."):"Laid out in a single layer the footprint overruns the deck, so we re-checked it with like items stacked; that is what closes the gap."),S||s.push("Treat this as a capacity check rather than a finished furniture plan: allow for the aisle and spacing you want, and tell me that requirement if you want the room re-checked around it.");let t=[];if(T&&t.push("nothing on the list is too tall for the ".concat(T," in ceiling")),M&&!I&&t.push("every piece clears the loading opening"),t.length){let e="".concat(t.join(", and "),".");s.push(e.charAt(0).toUpperCase()+e.slice(1))}S&&s.push(k?"Plan the load around it: cartons in full-height columns with the heaviest on the bottom, flat panels upright against a side wall, and the bulky pieces last. If any of it cannot be stacked, tell me which and I will re-run.":"Plan the load around it: build full-height columns of the like-sized pieces and keep the bulky ones for last. If any of it cannot be stacked, tell me which and I will re-run.")}else{let t="Your ".concat(p," items don't fit in a ").concat(c).concat(d," as-is.");null!=h?t+=" Their total volume only fills ~".concat(h,"% of the space, but "):t+=" ",t+=function(e,t){let n=(null==t?void 0:t.dims)||{},i=n.width_in,a=n.length_in,o=n.height_in,r=null==t?void 0:t.doorWidth_in,l=null==t?void 0:t.doorHeight_in;switch(e){case"floor_area":return"their combined floor footprint exceeds the usable area (we reserve ~25% as moving aisles".concat(i&&a?" inside the ".concat(i,"″\xd7").concat(a,"″ floor"):"",").");case"density":return"the total packed volume crosses the practical-fit threshold.";case"door":return"at least one item is too big to pass through the loading door".concat(r&&l?" (".concat(r,"″ \xd7 ").concat(l,"″)"):"",".");case"height":return"at least one item is taller than the interior ceiling".concat(o?" (".concat(o,"″)"):"",".");case"payload":return"the load exceeds the carrier's payload limit.";case"row_packing":return"items can't be tiled into rows that fit within the container's length.";default:return"they exceed the container's capacity."}}(e.limiting_constraint,m),s.push(t),s.push("Check any dimensions marked as estimates; if they are correct, reduce the load or use a larger space and tell me which change you want re-checked.")}s.push("")}if("DOESNT_FIT"===f&&(null==(t=e.recommendation)?void 0:t.nextSize)){let t=e.recommendation.nextSize;s.push("A **".concat(t.name,"** would fit your list (").concat(t.why,").")),s.push("")}if("DOESNT_FIT"===f&&Array.isArray(null==(n=e.recommendation)?void 0:n.leaveOut)&&e.recommendation.leaveOut.length>0){let t=e.recommendation.leaveOut,n=t.slice(0,3);for(let e of(s.push("**To make it fit, leave behind:**"),n)){let t=null!=e.freedVolume_ft3?" (~".concat(e.freedVolume_ft3," cf freed)"):"";s.push("- ".concat(e.qty," ").concat(e.name).concat(t))}t.length>n.length&&s.push("+ ".concat(t.length-n.length," more options ranked by volume freed")),s.push("")}else"DOESNT_FIT"===f&&e.recommendation&&!e.recommendation.leaveOut&&(s.push("*Some dims used database estimates — refine them above for a sharper recommendation.*"),s.push(""));let N=[],x=u.filter(e=>{if("catalog_fallback"===e.source||!e.dims)return!0;let t=String(e.dims).replace(/[\s"]/g,"");return/^0+×0+×0+$/.test(t)});if(x.length>0){let e=x.map(e=>e.name).join(", ");N.push("We couldn't find catalog dims for: ".concat(e,". Please measure these directly."))}for(let t of(u.filter(e=>"catalog_match"===e.source||"catalog"===e.source).length>=Math.ceil(.5*u.length)&&N.push("Most dims came from our furniture database — refine any items that are unusual sizes."),e.assumptions||[]))t&&"object"==typeof t&&t.kind&&o.has(t.kind)&&"string"==typeof t.detail&&t.detail.trim()&&N.push(t.detail);
1if(g&&N.push("Quantities for items you listed without a count (e.g. boxes, chairs) are estimated — set exact counts above for a precise result."),"DOESNT_FIT"===f&&"floor_area"===e.limiting_constraint&&N.push("Items are treated as rigid; bed frames and platforms that disassemble can shrink 3-5\xd7 when broken down."),N.length>0){for(let e of(s.push("**What this doesn't model:**"),N))s.push("- ".concat(e));s.push("")}let E=0===N.length&&w&&u.some(e=>(null==e?void 0:e.source)&&"user"!==e.source);return E&&(s.push("Sizes for the rows marked as estimates above are standard figures — correct any of them and I'll re-run this."),s.push("")),E||"HIGH"!==e.confidence&&"MEDIUM"!==e.confidence||s.push("Confidence: ".concat(e.confidence,".")),s.join("\n")}},16959:(e,t,n)=>{n.d(t,{EY:()=>i,Gd:()=>d,Yd:()=>h,_v:()=>u});let i={"10ft-moving-truck":{name:"10ft Moving Truck",displaySize:"10 ft",dimensions:{length:119,width:76,height:74},cubicFeet:402,rooms:"1-2 rooms",idealFor:["Studio apartment","Small bedroom","College dorm move","Large delivery"],maxWeight:2810,mpg:"12-14",description:"The 10-foot truck is the smallest standard rental size, perfect for studio apartments and single-room moves. It fits through most parking structures and is easier to maneuver than larger trucks.",faq:[{q:"What are the dimensions of a 10 foot moving truck?",a:"A 10 foot moving truck cargo box is about 119 inches long, 76 inches wide, and 74 inches tall inside (roughly 10 ft \xd7 6.3 ft \xd7 6.2 ft), or about 402 cubic feet. U-Haul, Penske, and Budget U-Haul is the major brand that rents this exact size; Budget and Penske start at 12 ft."},{q:"Will a queen mattress fit in a 10 foot truck?",a:"Yes. A queen mattress is 60 \xd7 80 inches, so it fits flat or on edge inside the 119 inch long, 76 inch wide cargo box with room left for a dresser and 20–25 medium boxes."},{q:"What size move is a 10 foot truck good for?",a:"A 10 foot truck suits a studio apartment, single bedroom, dorm move, or large furniture delivery — roughly 1–2 rooms. Its 2,810 lb payload is the limit for dense loads like books and tools."}],packingTips:["Fits a queen mattress with room to spare","Can hold a small sofa and 2-3 medium boxes","Ideal for Ikea furniture runs","Best fuel efficiency of all rental trucks"],whatFits:[{item:"Queen Mattress",quantity:1},{item:"Dresser",quantity:1},{item:"Small Sofa/Loveseat",quantity:1},{item:"Medium Boxes",quantity:"20-25"},{item:"Dining Chairs",quantity:"4-6"}],providers:["U-Haul"]},"15ft-moving-truck":{name:"15ft Moving Truck",displaySize:"15 ft",dimensions:{length:180,width:90,height:77},cubicFeet:764,rooms:"1-2 bedroom apartment",idealFor:["1-2 bedroom apartment","Large studio","Small home office","Mid-size delivery"],maxWeight:4300,mpg:"10-12",description:"The 15-foot truck hits the sweet spot for apartment moves. It offers significantly more space than a 10-footer while remaining easy to drive and park in urban areas.",faq:[{q:"What are the dimensions of a 15 foot moving truck?",a:"A 15 foot moving truck cargo box is about 180 inches long, 90 inches wide, and 77 inches tall inside (roughly 15 ft \xd7 7.5 ft \xd7 6.4 ft), or about 764 cubic feet. U-Haul and Enterprise rent this size; exact specs vary by fleet."},{q:"What fits in a 15 foot moving truck?",a:"A 15 foot truck holds a full 1–2 bedroom apartment: a king or queen bed, a sofa, two dressers, a dining table, and 40–50 medium boxes. The 90 inch interior width lets most mattresses lie flat."},{q:"How much can a 15 foot truck carry?",a:"A 15 foot rental truck has a payload near 4,300 lbs. Dense items — books, tools, packed wardrobe boxes — can reach that weight limit before the cargo box looks full, so spread heavy boxes across the floor."}],packingTips:["Can fit a full living room set","Room for a queen/king bed and dresser","Handles most apartment moves in one trip","Low enough for most parking garages"],whatFits:[{item:"King Mattress",quantity:1},{item:"Sofa",quantity:1},{item:"Dresser",quantity:2},{item:"Dining Table",quantity:1},{item:"Medium Boxes",quantity:"40-50"}],providers:["U-Haul","Enterprise"]},"20ft-moving-truck":{name:"20ft Moving Truck",displaySize:"20 ft",dimensions:{length:234,width:96,height:84},cubicFeet:1015,rooms:"2-3 bedroom home",idealFor:["2-3 bedroom home","Large apartment","Small office","Multi-room moves"],maxWeight:5700,mpg:"8-10",description:"The 20-foot truck is ideal for moving a typical 2-3 bedroom home. It provides enough space for furniture from multiple rooms plus a significant number of boxes.",faq:[{q:"What are the dimensions of a 20 foot moving truck?",a:"A 20 foot moving truck cargo box is about 234 inches long, 96 inches wide, and 84 inches tall inside (roughly 20 ft \xd7 8 ft \xd7 7 ft), or about 1,015 cubic feet. U-Haul rents this exact size; Penske's nearest is 22 ft, and exact fleet dimensions vary slightly."},{q:"Will a 20 foot truck move a 2-3 bedroom home?",a:"Yes. A 20 foot truck fits living room, bedroom, and dining furniture from a 2–3 bedroom home plus large appliances and 60–80 medium boxes, usually in one trip."},{q:"Does a refrigerator fit in a 20 foot moving truck?",a:"Yes. The 8 foot interior width and 7 foot height let a standard 36 inch wide refrigerator load and stand upright. Strap it against the wall and keep it upright to protect the compressor."}],packingTips:["Fits living room, bedroom, and dining room furniture","Can handle large appliances","Room for bulky items like exercise equipment","May require two peo
1ple for safe loading"],whatFits:[{item:"King Bed + Queen Bed",quantity:1},{item:"Sofa + Loveseat",quantity:1},{item:"Dining Set (6 person)",quantity:1},{item:"Refrigerator",quantity:1},{item:"Medium Boxes",quantity:"60-80"}],providers:["U-Haul"]},"26ft-moving-truck":{name:"26ft Moving Truck",displaySize:"26 ft",title:"26 ft U-Haul Dimensions: 26'5 \xd7 8'2 \xd7 8'3 Interior",metaDescription:"26 ft U-Haul / moving-truck interior dimensions: 26'5\" L \xd7 8'2\" W \xd7 8'3\" H, ~1,682 cu ft — holds a 3–4 bedroom home. See what fits and how to load it efficiently.",dimensions:{length:318,width:96,height:96},cubicFeet:1611,rooms:"4+ bedroom home",idealFor:["4+ bedroom home","Large family move","Commercial/office move","Multiple apartments"],maxWeight:9010,mpg:"6-8",description:"The 26-foot truck is the largest commonly available rental size. It can handle the contents of a 4-5 bedroom house in a single trip, making it the choice for large family moves.",queryExamples:[{heading:"26 ft U-Haul dimensions",body:"A 26 foot moving truck is usually about 318 inches long inside, 96 inches wide, and 96 inches tall in the cargo box. Rental-provider specs vary by fleet and year, so use those numbers as a planning baseline and measure the truck opening before loading bulky furniture."},{heading:"How big is a 26 foot moving truck?",body:"At roughly 1,600 cubic feet, a 26 foot box truck is built for large moves: multiple beds, a living room set, appliances, garage items, and 100 or more medium boxes. The limiting factor is often weight distribution and loading order, not just floor area."},{heading:"26 box truck dimensions for furniture fit",body:"The 8 foot interior width means queen and king mattresses fit upright or flat, standard refrigerators fit upright, and most sofas fit lengthwise. Tall dressers and appliances should be strapped against the wall, while long items should load first so they do not block the roll-up door."}],faq:[{q:"What are the dimensions of a 26 foot U-Haul truck?",a:"A common 26 foot rental truck cargo box is about 26.5 ft long, 8 ft wide, and 8 ft high inside, or roughly 318 x 96 x 96 inches. Exact U-Haul, Penske, and Budget fleet dimensions can vary."},{q:"Can a 26 foot truck move a 4 bedroom house?",a:"Often yes for a typical 4 bedroom home, but dense boxes, tools, books, and garage equipment can hit the weight limit before the cargo box is visually full."},{q:"Will a king mattress fit in a 26 foot moving truck?",a:"Yes. A king mattress is about 76 x 80 inches, so it fits flat or upright inside an 8 ft wide, 8 ft tall cargo box."},{q:"How many cubic feet is a 26 foot moving truck?",a:"A 26 foot box truck holds roughly 1,611 cubic feet (about 46 cubic meters) of cargo, with a maximum payload near 9,010 lbs (4,087 kg). That is enough for a 4–5 bedroom home in a single trip, though dense items like books and tools can reach the weight limit before the box looks full."},{q:"Will a 26 foot truck fit a car or motorcycle plus furniture?",a:"The 8 ft wide, 26.5 ft long cargo box can carry a motorcycle or ATV strapped at the front wall alongside household goods. A full-size car will not fit inside a standard box truck — you would need a separate car trailer or tow dolly, which most rental companies offer as an add-on."}],packingTips:["Fits entire home contents including garage items","Can transport vehicles like motorcycles or ATVs","Requires careful weight distribution","Consider liftgate option for heavy items"],whatFits:[{item:"Beds (mixed sizes)",quantity:"4-5"},{item:"Full Living Room Set",quantity:1},{item:"Washer + Dryer",quantity:1},{item:"Refrigerator",quantity:1},{item:"Medium Boxes",quantity:"100+"}],providers:["U-Haul","Penske","Budget"]}},a="U-Pack chart of U-Haul box-volume figures (conservative scale); RAW_TRUCK_DATA — https://www.upack.com/articles/u-haul-truck-sizes",o='src/data/container-types.json PODS interior dims (84–192"L \xd7 94"W \xd7 96"H); typical portable container, not a specific operator spec',r="Public Storage published sizes \xd7 8 ft ceiling — https://www.publicstorage.com/size-guide",l="U-Haul cargo van interior (rear cargo box) — https://www.uhaul.com/Truck-Rentals/Moving-Truck-Sizes/";function s(e,t,n,a,o){let r=i[n],l=r.cubicFeet;return{classId:e,family:"truck",label:t,interiorIn:r.dimensions,rawCubicFt:l,packingFactor:a,usableCubicFt:Math.round(l*a),source:o}}function m(e,t,n,i,a,o,r){let l=Math.round(n*i*a/1728);return{classId:e,family:"pod",label:t,interiorIn:{length:n,width:i,height:a},rawCubicFt:l,packingFactor:o,usableCubicFt:Math.round(l*o),source:r}}function c(e,t,n,i,a,o,r){let l=Math.round(n*i*a);return{classId:e,family:"storage",label:t,interiorFt:{width:n,depth:i,height:a},rawCubicFt:l,packingFactor:o,usableCubicFt:Math.round(l*o),source:r}}let d=[{classId:"cargo-van",family:"truck",label:"Cargo van",interiorIn:{length:114,width:67,height:56},rawCubicFt:245,packingFactor:.8,usableCubicFt:Math.round(196),source:l},s("truck-10","10-ft truck","10ft-moving-truck",.8,a),s("truck-15","15-ft truck","15ft-moving-truck",.8,a),s("truck-20","20-ft truck","20ft-moving-truck",.8,a),s("truck-26","26-ft truck","26ft-moving-truck",.8,a),m("pod-7","7-ft POD",84,94,96,.75,o),m("pod-12","12-ft POD",144,94,96,.75,o),m("pod-16","16-ft POD",192,94,96,.75,o),c("storage-5x5","5\xd75 storage unit",5,5,8,.65,r),c("storage-5x10","5\xd710 storage unit",5,10,8,.65,r),c("storage-10x10","10\xd710 storage unit",10,10,8,.65,r),c("storage-10x15","10\xd715 storage unit",10,15,8,.65,r),c("storage-10x20","10\xd720 storage unit",10,20,8,.65,r),c("storage-10x30","10\xd730 storage unit",10,30,8,.65,r)],h={name:"Cargo Van",displaySize:"Cargo van",dimensions:{length:114,width:67,height:56},cubicFeet:245,rooms:"Studio / single large item",idealFor:["Studio apartment (partial)","A few large items","Local one-load moves"],source:l};function u(e){return d.filter(t=>t.family===e).sort((e,t)=>
1e.usableCubicFt-t.usableCubicFt)}},18819:(e,t,n)=>{n.d(t,{db:()=>l,kW:()=>i,tX:()=>o});let i=Object.freeze({slot_closed:{width:!0,depth:!0,height:!0},slot_open_front:{width:!0,depth:!1,height:!0},slot_open_top:{width:!0,depth:!0,height:!1},slot_open_front_top:{width:!0,depth:!1,height:!1}});Object.freeze(Object.keys(i));let a=i.slot_closed;function o(e){return i[e]||a}let r=/\b(alcove|nook|recess|cavity)\b/i;function l(e){if(!e)return"slot_closed";if(e.geometry&&i[e.geometry])return e.geometry;let t=String(e.name||e.label||"");return r.test(t)?"slot_open_front_top":"slot_closed"}},19817:(e,t,n)=>{n.d(t,{c:()=>r,z:()=>o});let i={kg:1,g:.001,lb:.45359237,oz:.0283495231},a=1/i.lb;function o(e,t){if("number"!=typeof e||!isFinite(e)||e<0)return null;let n=i[(t||"").toLowerCase()];return null==n?null:e*n}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("number"!=typeof e||!isFinite(e)||e<0)return null;let n="kg"===t.unit?"kg":"lb",i="kg"===n?e:e*a,o=t.approximate?"~":"";return"".concat(o).concat(Math.round(i)," ").concat(n)}},20514:(e,t,n)=>{n.d(t,{CE:()=>r,IX:()=>s,to:()=>m,wt:()=>l});var i=n(11189),a=n(27236),o=n(87062);function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm];if(!Number.isFinite(t)||t<=0||i.some(e=>!Number.isFinite(e)||e<=0)||n.some(e=>/assumed|default/.test(null!=e?e:"")))return null;let a=Math.min(...i),o=t-a;return o>=0?null:{verdict:"DOESNT_FIT",obstruction_proven:!0,check_scope:"necessary_stair_width_bound",proof_variant:"exact_stair_width",continuous_path_proven:!1,pipeline_complete:!0,confidence:"HIGH",margin_mm:o,raw_margin_mm:o,effective_margin_mm:o,handling_buffer_mm:0,limiting_constraint:"stair_width",search_space_exhausted:!0,checked_orientations:[],orientationRationale:null,proofSteps:[...i.map((e,n)=>({id:"axis_inequality",passed:!1,limiting:n===i.indexOf(a),values:{item_dim_mm:e,space_dim_mm:t,axis:"stair_width",item_axis:["width","depth","height"][n],margin_mm:t-e},comparison:{actual_mm:e,limit_mm:t,margin_mm:t-e}})),{id:"min_required_space",passed:!1,limiting:!1,values:{item_dim_mm:a,tolerance_mm:0,required_space_mm:a,space_dim_mm:t,axis:"stair_width"},comparison:{actual_mm:t,limit_mm:a,margin_mm:o}},{id:"max_fitting_item",passed:!1,limiting:!1,values:{space_dim_mm:t,tolerance_mm:0,max_item_mm:t,item_dim_mm:a,axis:"stair_width"},comparison:{actual_mm:a,limit_mm:t,margin_mm:o}}],details:{best_orientation:null,best_orientation_dims:null},warnings:[],message:"The shortest item dimension exceeds the supplied nominal stair width in every orientation."}}let l="ItemFits can't confirm a stair carry yet. Your stairs are wide enough to try, but the turn onto and off the stairs isn't checked.";function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm];return!(!Number.isFinite(t)||t<=0||i.some(e=>!Number.isFinite(e)||e<=0)||n.some(e=>/assumed|default/.test(null!=e?e:"")))&&Math.min(...i)<=t}function m(e,t,n){var r,s,m,c,d;let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],{allowEnvelope:u=!0}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},_=n?{stairFlightCheck:n}:{};if(null==n||null==(r=n.candidates)?void 0:r.length){let e=n.candidates.reduce((e,t)=>e.margin_mm>t.margin_mm?e:t);_.strategy_evaluation={scope:n.scope,method:n.version,margin_mm:e.margin_mm,limiting_constraint:e.limiting_constraint}}else n&&Number.isFinite(e.margin_mm)&&(_.strategy_evaluation={scope:"legacy_slope_projection_only",method:e.method,margin_mm:e.margin_mm,limiting_constraint:e.limiting_constraint});if(t)return{...e,...t,..._,access_outcome_version:void 0,response_act:"answer",unknown_reason:void 0,needs_user_input:[],margin_unknown_reason:void 0,details:{...e.details,...t.details}};if(e.unknown_reason===a.r.MISSING_ITEM_DIMS)return e;let g=u?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&!e.unknown_reason&&!e.failed&&o.ct.has(e.verdict)&&Number.isFinite(e.margin_mm)?{...e,...t,check_scope:"stair_envelope",stair_model_basis:"envelope",continuous_path_proven:!1,obstruction_proven:!0===e.obstruction_proven,access_outcome_version:void 0,response_act:"answer",pipeline_complete:!1!==e.pipeline_complete,needs_user_input:[],margin_unknown_reason:void 0}:null}(e,_):null;if(g)return g;let p=h&&(!e.unknown_reason||function(e){var t,n;let i=null==(n=e.landingCheck)||null==(t=n.containedPivot)?void 0:t.status;return e.unknown_reason===a.r.GENUINELY_UNDERSPECIFIED&&!!i&&"invalid_or_missing_inputs"!==i}(e));return(0,i.Sp)({...e,..._,obstruction_proven:!1,warnings:null!=(s=null==n?void 0:n.limitations)?s:["Special stair bounds do n
1ot establish entry, exit or a continuous carry through the turn."],needs_user_input:[...new Set([...null!=(m=e.needs_user_input)?m:[],...null!=(c=null==n?void 0:n.needs_user_input)?c:[],"Measurements for the complete stair region, including room to hold the item in the same pose at both ends"])]},p?a.r.STAIR_CARRY_UNPROVEN:null!=(d=e.unknown_reason)?d:a.r.GENUINELY_UNDERSPECIFIED,p?e.landingCheck?"ItemFits can't confirm a stair carry yet. Your stairs are wide enough to try, but the turn at the landing and the turns onto and off the stairs aren't checked.":l:"I can't confirm this stair carry from the details given: the stair layout you described has parts I can't check yet, such as more than one flight or a turn I can't model.")}},20713:(e,t,n)=>{n.d(t,{Ao:()=>d,Bi:()=>h,FZ:()=>g,He:()=>I,JE:()=>k,N1:()=>a,St:()=>w,Zs:()=>M,do:()=>v,hy:()=>u,it:()=>f,jv:()=>T,kb:()=>b,s9:()=>S,vC:()=>y,w1:()=>_});let i=Object.freeze(["upright","folded","stowed","removed","not_present","partial_split","unknown"]),a=Object.freeze(["folded","stowed","removed","partial_split"]),o=Object.freeze(["behind_row_1","behind_row_2","behind_row_3","unknown"]),r=new Set(i),l=new Set(a),s=new Set(["folded","stowed","removed","not_present"]),m=["row2State","row3State"],c=Object.freeze({upright:"upright",folded:"folded",stowed:"stowed",removed:"removed",partial_split:"split-folded"});function d(e){if(!e||"truck_bed"===e.location_type)return null;let t=r.has(e.row2_state)&&r.has(e.row3_state),n=r.has(e.row2_state)?e.row2_state:"unknown",i=r.has(e.row3_state)?e.row3_state:"unknown";return Object.freeze({row2State:n,row3State:i,seatConfigId:r.has(n)&&r.has(i)?"r2_".concat(n,"__r3_").concat(i):null,annotated:t})}function h(e){return!!e&&"unknown"!==e.row2State&&"unknown"!==e.row3State}function u(e){if(!e)return!1;let t=m.map(t=>e[t]);return!!t.some(e=>l.has(e))||!!t.includes("unknown")&&null}function _(e,t){let n=u(e);return null===n?!!t:n}function g(e){return e?h(e)?m.filter(t=>l.has(e[t])).length:null:0}function p(e,t){if(!h(e)||!h(t))return null;for(let n of m)if("not_present"===e[n]!=("not_present"===t[n])||l.has(t[n])&&!l.has(e[n]))return!1;return!0}function f(e,t){let n=p(e,t),i=p(t,e);return null===n||null===i?null:n&&!i}function w(e){let t=(e||[]).filter(e=>e&&"unknown"!==e.row3State);return!!t.some(e=>"not_present"!==e.row3State)||!t.length&&null}function v(e,t){if(null==e||"unknown"===e)return!0;if(!o.includes(e))return!1;if(!h(t))return null;let{row2State:n,row3State:i}=t;return"behind_row_3"===e?"upright"===n&&"upright"===i:"behind_row_2"===e?"upright"===n&&s.has(i):s.has(n)&&"not_present"!==n&&s.has(i)}function b(e){if(!e)return null;let{row2State:t,row3State:n}=e;return"not_present"===t?"not_present"===n?"No rear seats":"Seat configuration not confirmed":"not_present"===n?"upright"===t?"All seats upright (behind 2nd row)":"unknown"===t?"Seat configuration not confirmed":"2nd row ".concat(c[t]):"unknown"===t&&"unknown"===n?"Seat configuration not confirmed":"upright"===t?"upright"===n?"All seats upright (behind 3rd row)":"unknown"===n?"2nd row upright (3rd row position not confirmed)":"3rd row ".concat(c[n]," (2nd row upright)"):"unknown"===t?"3rd row ".concat(c[n]," (2nd row position not confirmed)"):"unknown"===n?"2nd row ".concat(c[t]," (3rd row position not confirmed)"):"upright"===n?"2nd row ".concat(c[t]," (3rd row upright)"):t===n?"2nd and 3rd rows ".concat(c[t]):"2nd row ".concat(c[t],", 3rd row ").concat(c[n])}function y(e){if(!e)return null;if(!h(e))return"in a seat configuration that is not confirmed";let{row2State:t,row3State:n}=e,i=m.filter(t=>l.has(e[t]));if(!i.length)return"with all seats upright";if(2===i.length)return t===n?"with the 2nd and 3rd rows ".concat(c[t]):"with the 2nd row ".concat(c[t]," and the 3rd row ").concat(c[n]);let a=i[0];return"with the ".concat("row2State"===a?"2nd":"3rd"," row ").concat(c[e[a]])}function T(e){let t=(e||[]).filter(Boolean);return t.length&&t.every(h)?!t.some(e=>m.every(t=>s.has(e[t])&&"partial_split"!==e[t])):null}function I(e){let{locationKey:t,sourceLabel:n,isPassengerSpace:i,seatConfiguration:a}=e,o=i||!a?null:function(e,t){let n=String(e||"");if(n.startsWith("rear_seat"))return"Rear cabin";if(!n.startsWith("rear_cargo"))return null;let i=/^(trunk|boot)\b/i.exec(String(t||""));return i?i[1].charAt(0).toUpperCase()+i[1].slice(1).toLowerCase():"Cargo area"}(t,n);if(!o)return null!=n?n:null;let r=b(a);return"".concat(o,", ").concat(r.charAt(0).toLowerCase()).concat(r.slice(1))}function M(e){let{label:t,seatConfiguration:n,requiresSeatFolding:i}=e,a=n?u(n):null;return!1===a?null:!0===a&&h(n)?'Uses "'.concat(t,'": ').concat(y(n).replace(/^with /,""),"."):!0===a?'Uses "'.concat(t,'"; the position of every seat in that layout is not confirmed for this vehicle.'):i?'Uses "'.concat(t,'", a layout recorded as needing seats folded; which seats is not confirmed for this vehicle.'):null}function S(e){let{seatConfiguration:t,requiresSeatFolding:n}=e,i=t?u(t):null;return!0===i?"seats_folded":!1===i?"seats_upright":n?"seat_configuration_unconfirmed":"seats_upright"}function k(e,t){let{seatConfiguration:n,requiresSeatFolding:i,label:a}=t,o=n?u(n):null;return!0===o&&h(n)?"The ".concat(e," fits, but only ").concat(y(n)," — plan for fewer passengers on this trip."):!0===o?"The ".concat(e," fits in the ").concat(a||"cargo area",", which needs seats folded; the position of every seat in that layout is not confirmed for this vehicle, so check before loading."):null===o&&i?"The ".concat(e," fits in the ").concat(a||"cargo area",", a layout recorded as needing seats folded. Which seats is not confirmed for this vehicle, so check before loading."):null}},22110:(e,t,n)=>{n.d(t,{f:()=>s,solveArrangement:()=>o});var i=n(5979);let a=["back","left","right","center"];function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{allowedOrientations:o=null,obstacles:s=[],preserveOrder:m=!1}=n;if(!e||0===e.length)return{placements:[],feasible:!0,utilization:0,walkingPath:!0,warnings:[]};let c=t.width_mm,d=t.depth_mm,h=t.height_mm||1/0,u=c*d,_=m?[...e]:[...e].sort((e,t)=>
1{let n=e.width_mm*e.depth_mm,i=t.width_mm*t.depth_mm;return i!==n?i-n:(e.name||"").localeCompare(t.name||"")}),g=[],p=[],f=[],w=!0;for(let e=0;e<_.length;e++){let t=_[e],n=function(e,t){let{width_mm:n,depth_mm:i,height_mm:a}=e,o=[{w:n,d:i,h:a},{w:i,d:n,h:a}];return t&&0!==t.length?o.filter(e=>t.some(t=>25.4>=Math.abs(e.w-t.w)&&25.4>=Math.abs(e.d-t.d))):o}(t,o);if(0===n.length){w=!1,f.push("No valid orientation for ".concat(t.name||"item"," after path filter"));continue}if(Math.min(t.width_mm,t.depth_mm,t.height_mm)>h){w=!1,f.push("".concat(t.name||"Item"," is taller than the ceiling in every orientation"));continue}let i=function(e,t,n,i,a,o,s,m){for(let m of s)for(let s of t){if(s.h>a)continue;let t=function(e,t,n,i,a){switch(e){case"back":return{x:Math.max(0,(n-t.w)/2),y:0};case"left":return{x:0,y:t.d>i?0:914};case"right":return{x:Math.max(0,n-t.w),y:t.d>i?0:914};case"center":return{x:Math.max(0,(n-t.w)/2),y:Math.max(0,(i-t.d)/2)};default:return null}}(m,s,n,i,0);if(t&&!(t.x+s.w>n)&&!(t.y+s.d>i)){if(r(t.x,t.y,s.w,s.d,o)){let a=function(e,t,n,i,a,o){if("back"===e||"center"===e)for(let e=1;e<=40;e++){let a=t.x+152*e;if(a+n.w<=i&&!r(a,t.y,n.w,n.d,o))return{x:a,y:t.y};let l=t.x-152*e;if(l>=0&&!r(l,t.y,n.w,n.d,o))return{x:l,y:t.y}}if("left"===e||"right"===e)for(let e=1;e<=40;e++){let i=t.y+152*e;if(i+n.d<=a&&!r(t.x,i,n.w,n.d,o))return{x:t.x,y:i}}for(let e=1;e<=10;e++){let t=e*(n.d+914);for(let e=0;e<=40;e++){let l=152*e;if(l+n.w<=i&&t+n.d<=a&&!r(l,t,n.w,n.d,o))return{x:l,y:t}}}return null}(m,t,s,n,i,o);if(a)return l(e,a,s,m,n,i);continue}return l(e,t,s,m,n,i)}}return null}(t,n,c,d,h,p,a,e);if(i)g.push(i),p.push({x:i.position.x,y:i.position.y,w:i.orientation.w,d:i.orientation.d});else{w=!1;let e=u-p.reduce((e,t)=>e+t.w*t.d,0);t.width_mm,t.depth_mm,t.width_mm,t.height_mm,t.depth_mm,t.height_mm,f.push("Cannot place ".concat(t.name||"item"," — ")+"remaining floor area (~".concat(Math.round(e/645.16)," sq in) insufficient with clearance"))}}let v=function(e,t,n){if(0===e.length)return!0;for(let t of e){let e=t.clearance.left,n=t.clearance.right,i=t.clearance.front;if(!(e>=914)&&!(n>=914)&&!(i>=914))return!1}return!0}(g,0,0),b=g.reduce((e,t)=>e+t.orientation.w*t.orientation.d,0),y=u>0?Math.round(b/u*100)/100:0;return(0,i.H)("arrangement",{placements:g,feasible:w,utilization:y,walkingPath:v,warnings:f})}function r(e,t,n,i,a){for(let o of a)if(e<o.x+o.w&&e+n>o.x&&t<o.y+o.d&&t+i>o.y)return!0;return!1}function l(e,t,n,i,a,o){let r={front:o-t.y-n.d,left:t.x,right:a-t.x-n.w,back:t.y};return{item:e.name||"item",position:{x:Math.round(t.x),y:Math.round(t.y)},orientation:{w:n.w,d:n.d,h:n.h},wall:i,description:function(e,t){let{position:n,orientation:i}=e,{x:a,y:o}=n,{w:r,d:l}=i,s=t.width_mm;t.depth_mm;let m=[],c=s-a-r,d=Math.abs(a+r/2-s/2)/s<.1;return o<=152?a<=152?m.push("In the left corner, against the back wall"):c<=152?m.push("In the right corner, against the back wall"):d?m.push("Along the back wall, centered"):m.push("Along the back wall"):a<=152?m.push("Against the left wall"):c<=152?m.push("Against the right wall"):o<=610?m.push("Near the back wall"):a<=610?m.push("Near the left wall"):c<=610?m.push("Near the right wall"):m.push("In the center of the room"),m.join(", ")}({position:t,orientation:n},{width_mm:a,depth_mm:o}),clearance:{front:Math.round(r.front),left:Math.round(r.left),right:Math.round(r.right)}}}function s(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{trials:a=50,timeBudget_ms:r=200,seed:l=Date.now(),allowedOrientations:s=null}=i;if(!e||e.length<=1)return o(e,t,{allowedOrientations:s});let m=(n=0|l,function(){let e=Math.imul((n=n+0x6d2b79f5|0)^n>>>15,1|n);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/0x100000000}),c=Date.now(),d=null,h=-1/0,u=0;for(let n=0;n<a;n++){var _;if(Date.now()-c>r)break;let n=o(function(e,t){let n=[...e];for(let e=n.length-1;e>0;e--){let i=Math.floor(t()*(e+1));[n[e],n[i]]=[n[i],n[e]]}return n}(e,m),t,{allowedOrientations:s,preserveOrder:!0});u++;let i=0;if(n.feasible&&(i+=1e4),i+=1e3*n.utilization,n.walkingPath&&(i+=100),(i-=10*((null==(_=n.warnings)?void 0:_.length)||0))>h&&(h=i,d=n),n.feasible&&n.walkingPath&&n.placements.length===e.length)break}return d||(d=o(e,t,{allowedOrientations:s})),d._multiTrial={trialsRun:u,timeBudget_ms:r,seed:l},d}}
1,23033:(e,t,n)=>{n.d(t,{extractComparisonScenarios:()=>u,solveComparison:()=>p});var i=n(90453),a=n(65927),o=n(96703),r=n(5979);let l=/(\d+)\s*(?:ft|foot|')\s*(?:or|vs\.?|versus)\s*(\d+)\s*(?:ft|foot|')\s*(truck|van|vehicle|trailer)?/i,s=/(?:the\s+)?(\w[\w\s]*?)\s+(?:or|vs\.?|versus|instead\s+of)\s+(?:the\s+)?(\w[\w\s]*?)(?:\s+(?:for|to)\b|$)/i,m=/(front|back|side|garage)\s+door\s+(?:or|vs\.?|versus)\s+(front|back|side|garage)\s+door/i,c=/compare\s+(?:the\s+)?(.+?)\s+(?:and|with|to|vs\.?|versus)\s+(?:the\s+)?(.+?)(?:\s+for\b|$)/i,d=new Set(["doorway","opening","hallway","stairs","turn"]),h=/\b(?:room|bedroom|living\s*room|office|garage|kitchen|bathroom|den|studio|nursery|basement|attic)\b/i;function u(e){if(!e)return[];let t=l.exec(e);if(t){let[,e,n,i="truck"]=t;return[{space:{name:"".concat(e,"ft ").concat(i),type:"vehicle",dimensions:{length:12*parseInt(e),width:72,height:72}}},{space:{name:"".concat(n,"ft ").concat(i),type:"vehicle",dimensions:{length:12*parseInt(n),width:72,height:72}}}]}let n=m.exec(e);if(n){let[,e,t]=n;return[{space:{name:"".concat(e," door"),type:"doorway"}},{space:{name:"".concat(t," door"),type:"doorway"}}]}let i=c.exec(e);if(i){let[,e,t]=i;return[{space:{name:e.trim(),type:_(e)}},{space:{name:t.trim(),type:_(t)}}]}let a=s.exec(e);if(a){let[,e,t]=a;return/^\d+$/.test(e.trim())||/^\d+$/.test(t.trim())?[]:[{space:{name:e.trim(),type:_(e)}},{space:{name:t.trim(),type:_(t)}}]}return[]}function _(e){if(!e)return"room";let t=e.toLowerCase();return/door/i.test(t)?"doorway":/hallway|corridor|hall/i.test(t)?"hallway":/stair/i.test(t)?"stairs":/truck|van|vehicle|suv|minivan|trailer/i.test(t)?"vehicle":(h.test(t),"room")}function g(e){if(!e)return{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_NOT_COMPUTED",isFit:!1,details:null};let t=e.verdict||"UNKNOWN",n=Number.isFinite(e.margin_mm)?e.margin_mm:null,i="string"==typeof t&&/^FITS/i.test(t);return{verdict:t,margin_mm:n,isFit:i,confidence:e.confidence||"LOW",details:e.details||null,bestOrientation:e.best_orientation||e.bestOrientation||null,tightestPoint:e.limiting_constraint||e.tightest_point||null,checkedOrientations:e.checked_orientations||[]}}function p(e,t,n){let l=Array.isArray(t)?t:[];if(l.length>4)return{scenarioResults:[],winner:null,allFit:!1,allFail:!1,tooMany:!0,queryType:"comparison",classification:n,items:e};let s=l.map((t,n)=>{var r,l,s;let m=function(e,t,n){if(!t)return{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",isFit:!1,details:null};let r=null==e?void 0:e[0],l=t.type||"room",s=t.dimensions_mm||(t.dimensions?{length:25.4*(t.dimensions.length||0),width:25.4*(t.dimensions.width||0),height:25.4*(t.dimensions.height||0)}:null),m=Number(null==r?void 0:r.width_mm)>0||Number(null==r?void 0:r.depth_mm)>0||Number(null==r?void 0:r.height_mm)>0?{length:Number(null==r?void 0:r.width_mm)||0,width:Number(null==r?void 0:r.depth_mm)||0,height:Number(null==r?void 0:r.height_mm)||0}:(null==r?void 0:r.dimensions_mm)||((null==r?void 0:r.dimensions)?{length:25.4*(r.dimensions.length||0),width:25.4*(r.dimensions.width||0),height:25.4*(r.dimensions.height||0)}:null);try{if(d.has(l)){let e={width_mm:(null==s?void 0:s.width)||(null==s?void 0:s.length)||0,height_mm:(null==s?void 0:s.height)||0},t=m?{length:m.length,width:m.width,height:m.height}:null,n=(0,o.wV)(t,e);return g(n)}if("room"===l){let e=s?{length:s.length,width:s.width,height:s.height}:null,t=m?{length:m.length,width:m.width,height:m.height}:null,n=(0,i.Cp)(t,e);return g(n)}let e=s?{length:s.length,width:s.width,height:s.height}:null,t=m?{length:m.length,width:m.width,height:m.height}:null,n=(0,a.GV)(e,t?[t]:[]);return g(n)}catch(e){return{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_SOLVER_ERROR",isFit:!1,details:null}}}(e,t.space,0);return{scenarioName:(null==(r=t.space)?void 0:r.name)||"Option ".concat(n+1),spaceType:(null==(l=t.space)?void 0:l.type)||null,spaceDims_mm:(null==(s=t.space)?void 0:s.dimensions_mm)||null,...m}}),{winner:m,allFit:c,allFail:h}=function(e){let t=e.filter(e=>e.isFit),n=0===e.filter(e=>!e.isFit).length&&t.length>0,i=0===t.length&&e.length>0,a=null;if(1===t.length)a={scenarioIndex:e.indexOf(t[0]),reason:"only_fit"};else if(t.length>1){let t=-1,n=-1/0;for(let i=0;i<e.length;i++)e[i].isFit&&e[i].margin_mm>n&&(n=e[i].margin_mm,t=i);t>=0&&(a={scenarioIndex:t,reason:"more_margin"})}return{winner:a,allFit:n,allFail:i}}(s);return(0,r.H)("comparison",{scenarioResults:s,winner:m,allFit:c,allFail:h,tooMany:!1,queryType:"comparison",classification:n,items:e})}},24121:(e,t,n)=>{n.d(t,{iG:()=>p.iG,uH:()=>y.uH,KZ:()=>y.KZ,Ri:()=>V,hD:()=>W,pg:()=>N,lD:()=>p.lD,Xz:()=>p.Xz,Mt:()=>p.Mt,aV:()=>p.aV,fi:()=>p.fi});var i=n(98224);let a={FITS:{comfortable:"**FITS** ✓\n\nClears the opening comfortably with {margin}{unit} to spare — tightest point is the {limitingAxis}.\n\nThe widest cross-section sets the limit, and there is room to spare.",standard:"**FITS** ✓\n\nFits through the opening with {margin}{unit} clearance — tightest point is the {limitingAxis}.\n\nThe clearance is adequate but not generous — take care with edges and corners."},FITS_ROTATED:{comfortable:"**FITS** ✓\n\nWon't go straight through ({itemBlockingDim}{unit} exceeds the {openingDim}{unit} opening), but orienting the {fittingDim}{unit} side toward the opening gives {margin}{unit} clearance.\n\nThe key factor is the rotation — the {fittingDim}{unit} dimension must face the opening to clear it.",standard:"**FITS** ✓\n\nWon't fit straight through ({itemBlockingDim}{unit} exceeds {openingDim}{unit}), but orienting the {fittingDim}{unit} side toward the opening works with {margin}{unit} to spare.\n\nThe blocking dimension is {itemBlockingDim}{unit}, which is {straightExcess}{unit} over — rotation is required."},FITS_VERY_TIGHT:{standard:"**FITS — VERY TIGHT** ⚠️\n\nNear the limit — only {margin}{unit} clearance before obstructions.\n\nBinding constraint: {bindingLabel}. Verify in person. Measure interior obstructions before attempting."},FITS_VERY_TIGHT_ROTATED:{standard:"**FITS — VERY TIGHT** ⚠️\n\nNear the limit when {rotationDesc} — only {margin}{unit} clearance. Won't fit straight through ({itemBlockingDim}{unit} exceeds {openingDim}{unit} by {straightExcess}{unit}).\n\nBinding constraint: {bindingLabel}. Verify in person. Measure interior obstructions before attempting."},FITS_TIGHT:{standard:"**TIGHT FIT** ✓\n\nIt fits, but only {margin}{unit} of clearance — tightest point is the {limitingAxis}.\n\nThe margin is slim, so careful maneuvering is essential to avoid scuffing.",veryTight:"**TIGHT FIT** ✓\n\nBarely fits with only {margin}{unit} to spare — tightest point is the {limitingAxis}.\n\nEvery fraction of clearance counts at this margin."},FITS_TIGHT_ROTATED:{standard:"**TIGHT FIT** ✓\n\nTight fit, and only when {rotationDesc}. Won't fit straight through ({itemBlockingDim}{unit} exceeds {openingDim}{unit} by {straightExcess}{unit}).\n\nThe tightest point is the {limitingDim}{unit} dimension passing through the opening {limitingAxis} with only {margin}{unit} clearance.",veryTight:"**TIGHT FIT** ✓\n\nVery tight, only when {rotationDesc}. Won't fit straight through ({itemBlockingDim}{unit} exceeds {openingDim}{unit} by {straightExcess}{unit}).\n\nOnly {margin}{unit} clearance in the rotated orientation — extremely tight."},DOESNT_FIT:{standard:"**DOESN'T FIT** ✕\n\nExceeds the {openingDim}{unit} opening by {excess}{unit} — no orientation works.\n\nThe blocking dimension is larger than the opening in all possible orientations.",noOpeningDim:"**DOESN'T FIT** ✕\n\nExceeds the opening by {excess}{unit} — no orientation works.\n\nThe blocking dimension is larger than the opening in all possible orientations.",withBlocking:"**DOESN'T FIT** ✕\n\nThe {blockingDim}{unit} dimension exceeds the {openingDim}{unit} opening by {excess}{unit}.\n\nThis is the smallest usable cross-section, so no rotation or reorientation will help.",withNearMiss:"**DOESN'T FIT** ✕\n\nThe {blockingDim}{unit} dimension exceeds the {openingDim}{unit} opening by {excess}{unit} in its natural orientation.\n\nHowever, when {nearMissRotation} ({nearMissDims}), there is {nearMissMargin}{unit} of raw clearance — below the {tolerance}{unit} practical handling margin. Technically possible but extremely tight."},CROSS_CONSTRAINT_DOESNT_FIT:{standard:"**DOESN'T FIT** ✕\n\nFits through the door and fits in the hallway separately, but no single orientation works for both simultaneously.\n\nThe door requires one orientation while the hallway requires another — the item cannot be moved through both in the same position."},CROSS_CONSTRAINT_ROTATION_BLOCKED:{standard:"**DOESN'T FIT** ✕\n\nFits through the door when tilted ~{angle}\xb0, but the rotation arc sweeps {sweep}{unit} wide — exceeding the {hallwayWidth}{unit} hallway.\n\nThe item cannot be rotated into the required orientation within the corridor."}},o={DOESNT_FIT:{withDim:"**DOESN'T FIT** ✕\n\nToo big for the stairway — exceeds the {stairDim} {constraintNoun} by {excess}.\n\nThe {constraintNoun} is the limiting factor, and no orientation gets the item up the stairs.",standard:"**DOESN'T FIT** ✕\n\nToo big for the stairway — the {constraintNoun} is the limiting factor.\n\nNo orientation gets the item up the stairs."},FITS_VERY_TIGHT:{standard:"**FITS — VERY TIGHT** ⚠️\n\nClears the stairway by only {margin} on the {constraintNoun} — right at the limit.\n\nVerify in person and measure obstructions before carrying it up."},FITS_TIGHT:{standard:"**TIGHT FIT** ✓\n\nGoes up the stairs with only {margin} of {constraintNoun} clearance.\n\nThe margin is slim — careful, slow handling is essential."},FITS:{standard:"**FITS** ✓\n\nClears the stairway with {margin} of {constraintNoun} clearance.\n\nThere is workable room on the limiting axis — mind edges and corners."},LIKELY_DOESNT_FIT:{assumedWithDim:"**LIKELY DOESN'T FIT** ⚠️\n\nOn a standard staircase it is over by {excess} at the {stairDim} {constraintNoun}.\n\nWe are working from standard stair dimensions — we do not have yours yet. Add your staircase's clear width and headroom for a definite answer.",assumed:"**LIKELY DOESN'T FIT** ⚠️\n\nOn a standard staircase the {constraintNoun} is the limiting factor.\n\nWe are working from standard stair dimensions — we do not have yours yet. Add your staircase's clear width and headroom for a definite answer.",withDim:"**LIKELY DOESN'T FIT** ⚠️\n\nIt looks over by {excess} at the {stairDim} {constraintNoun}.\n\nSome dimensions were estimated rather than measured — verify before ruling it out.",standard:"**LIKELY DOESN'T FIT** ⚠️\n\nThe {constraintNoun} looks like the limiting factor.\n\nSome dimensions were estimated rather than measured — verify before ruling it out."},LIKELY_FITS:{assumed:"**LIKELY FITS** ⚠️\n\nOn a standard staircase it clears by {margin} on the {constraintNoun}.\n\nWe are working from standard stair dimensions — we do not have yours yet. Add your staircase's clear width and headroom for a definite answer.",standard:"**LIKELY FITS** ⚠️\n\nIt should clear by {margin} on the {constraintNoun}.\n\nSome dimensions were estimated rather than measured — verify before committing."}},r={FITS:{single:"**FITS** ✓\n\n{clearanceDetail}.\n\nThe tightest axis determines the margin. Protect edges with moving blankets.",multiple:"**FITS** ✓\n\n{itemLabel} fit together with {margin}{unit} clearance.\n\nThe tightest arrangement still leaves workable room across all dimensions.",stacked:"**FITS** ✓\n\n{itemLabel} fit when {strategy} with {margin}{unit} clearance.\n\nThe stacking arrangement is the key — it maximizes the available space."},FITS_VERY_TIGHT:{single:"**FITS — VERY TIGHT** ⚠️\n\n{clearanceDetail} — near the limit.\n\nVerify in person. Measure interior obstructions before attempting.",multiple:"**FITS — VERY TIGHT** ⚠️\n\n{itemLabel} fit, but near the limit with only {margin}{unit} clearance.\n\nVerify in person. Measure interior obstructions before attempting."},FITS_TIGHT:{single:"**TIGHT FIT** ✓\n\n{clearanceDetail} — handle with care.\n\nThe margin is slim, so precise placement is important.",multiple:"**TIGHT FIT** ✓\n\n{itemLabel} fit, but tight with only {margin}{unit} clearance.\n\nThe combined footprint leaves very little breathing room."},LIKELY_FITS:{standard:"**FITS** ✓\n\nBased on the dimensions provided, {itemLabelLower} should fit with {margin}{unit} margin.\n\n{caveat}"},LIKELY_DOESNT_FIT:{standard:"**DOESN'T FIT** ✕\n\nNo standard packing arrangement works — {itemLabelLower} exceeds the container by {excess}{unit}.\n\nThe combined dimensions are too large for any conventional orientation.",withStrategy:"**DOESN'T FIT** ✕\n\nThe {strategy} arrangement exceeds the container by {excess}{unit}.\n\nCreative angled placement might work, but standard orientations all fail."},DOESNT_FIT:{single:"**DOESN'T FIT** ✕\n\n{failDetail}.\n\nNo orientation change resolves the size mismatch.",volume:"**DOESN'T FIT** ✕\n\nCombined volume of {itemLabelLower} exceeds container capacity.\n\nEven with optimal packing, the total volume is too large.",dimension:"**DOESN'T FIT** ✕\n\n{failDetail}.\n\nThe blocking dimension exceeds the container in all orientations.",multiple:"**DOESN'T FIT** ✕\n\n{itemLabel} cannot fit together — exceeds the container by {excess}{unit}.\n\nThe combined footprint is too large for the available space."},FITS_WONT_CLOSE:{single:"**FITS — WON'T CLOSE** ✓\n\n{itemLabel} fits inside but exceeds the closure line by {excess}{unit}.\n\nThe {closureDesc} won't shut — {itemLabelLower} stands too tall for full closure.",clamshell:"**FITS — WON'T CLOSE** ✓\n\n{itemLabel} fits in one half but at {itemDim}{unit} it exceeds the {halfDepth}{unit} half-depth by {excess}{unit}.\n\nThe {containerName} won't close because {itemLabelLower} bridges both halves.",lid:"**FITS — WON'T CLOSE** ✓\n\n{itemLabel} sits inside but stands {excess}{unit} above the lid line.\n\n{itemLabel} is too tall for the lid to close flush."},CLARIFY:{missingDims:"**INSUFFICIENT DATA** ✕\n\n{missingInfo}.\n\nWithout {missingDimensions}, a reliable fit determination cannot be made.",ambiguous:"**CLARIFY** ✕\n\n{reason}.\n\nPlease provide the missing measurements."}},l={FITS:'Tap "View" to see exactly how the layout works.',FITS_VERY_TIGHT:'Tap "View" to see the exact clearances involved.',FITS_TIGHT:'Tap "View" to see the exact clearances involved.',FITS_WONT_CLOSE:'Tap "View" to see how the item sits inside.',LIKELY_FITS:'Tap "View" to see the estimated arrangement.',LIKELY_DOESNT_FIT:'Tap "View" to see exactly where it fails.',DOESNT_FIT:'Tap "View" to see exactly where it fails.'},s={FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits in the room with {minWalkway}{unit} walkways — comfortable for daily use.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} walkways when {strategyDesc}.\n\n{walkwayBreakdown} You'll have functional space around the item for daily use."},FITS_TIGHT:{standard:"**TIGHT BUT FUNCTIONAL** ✓\n\n{itemLabel} fits, but walkways are tight at {minWalkway}{unit} when {strategyDesc}.\n\n{walkwayBreakdown} Functional, but consider whether you need space for other furniture."},FITS_VERY_TIGHT:{standard:"**VERY TIGHT** ⚠️\n\n{itemLabel} physically fits, but only {minWalkway}{unit} walkway space when {strategyDesc}.\n\n{walkwayBreakdown} Moving around the room will be difficult — shimmy access only. Measure in person before committing."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} doesn’t leave enough walkway space — not practical for daily use in this room.\n\n{walkwayBreakdown} The room is too small for this item with usable access around it.",floor:"**DOESN'T FIT** ✕\n\n{itemLabel} is physically larger than the room floor in every orientation.\n\nNo placement works — the item exceeds the room dimensions.",ceiling:"**DOESN'T FIT** ✕\n\n{itemLabel} is {excess}{unit} taller than the ceiling ({roomHeight}{unit}).\n\nThe item won't stand upright in this room."},CLARIFY:{standard:"**INSUFFICIENT DATA** ✕\n\n{reason}\n\nPlease provide the missing measurements to get an accurate room fit analysis."}}
1,m={bed:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits in the room with {minWalkway}{unit} walkways on each accessible side — plenty of space to get in and out of bed.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} walkways when {strategyDesc}.\n\n{walkwayBreakdown} Enough room to access both sides and make the bed."},FITS_TIGHT:{standard:"**TIGHT BUT FUNCTIONAL** ✓\n\n{itemLabel} fits, but walkways are tight at {minWalkway}{unit} when {strategyDesc}.\n\n{walkwayBreakdown} You can get in and out, but making the bed will be a squeeze."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} in this room leaves only {minWalkway}{unit} walkways per side — below the 24″ minimum needed to get in and out of bed.\n\n{walkwayBreakdown} The room can't support this bed with usable access."}},couch:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits with {minWalkway}{unit} clearance in front — comfortable for sitting and walking past.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} clearance when {strategyDesc}.\n\n{walkwayBreakdown} Enough space for walking past and sitting down."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} leaves under 18″ clearance in front in every orientation — no room to walk past or use seating comfortably.\n\n{walkwayBreakdown} The room is too small for this sofa with usable access."}},dining_table:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits with {minWalkway}{unit} pull-out clearance per side — plenty of room for seating and movement.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} pull-out clearance when {strategyDesc}.\n\n{walkwayBreakdown} Enough space for chairs and access on all sides."},FITS_TIGHT:{standard:"**TIGHT BUT FUNCTIONAL** ✓\n\n{itemLabel} fits, but pull-out clearance is tight at {minWalkway}{unit} when {strategyDesc}.\n\n{walkwayBreakdown} Guests may need to squeeze past seated diners."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} doesn't leave enough clearance for chairs — only {minWalkway}{unit} per side.\n\n{walkwayBreakdown}
1 36″ pull-out clearance per side is needed for comfortable seating."}},office_desk:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits with {minWalkway}{unit} behind the chair — comfortable for pushing back and standing.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} clearance behind the chair when {strategyDesc}.\n\n{walkwayBreakdown} Functional workspace with room to move."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} leaves only {minWalkway}{unit} behind the chair — not enough to push back or stand up comfortably.\n\n{walkwayBreakdown} Standard ergonomic clearance is 36″ behind the chair."}},bookshelf:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits against the wall with {minWalkway}{unit} of open floor space in front — plenty of room to browse and access shelves.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} in front when {strategyDesc}.\n\n{walkwayBreakdown} Enough room to stand and access shelves."}},wardrobe:{FITS:{comfortable:"**FITS COMFORTABLY** ✓\n\n{itemLabel} fits with {minWalkway}{unit} clearance in front for door swing — comfortable for daily use.\n\n{walkwayBreakdown} Best placement: {strategyDesc}.",standard:"**FITS** ✓\n\n{itemLabel} fits with {minWalkway}{unit} clearance when {strategyDesc}.\n\n{walkwayBreakdown} Enough space for opening doors and accessing contents."},DOESNT_FIT:{walkway:"**DOESN'T FIT** ✕\n\n{itemLabel} leaves only {minWalkway}{unit} in front — not enough for door swing clearance.\n\n{walkwayBreakdown} 24″ minimum in front is needed for door swing."}}},c={bed:"Consider whether both sides need to be accessible (nightstands, making the bed).",office_desk:"Standard ergonomic clearance is 36″ behind the chair for pushing back.",desk:"Standard ergonomic clearance is 36″ behind the chair for pushing back.",dining_table:"36″ pull-out clearance per side is needed for c
1omfortable seating.",wardrobe:"24″ minimum in front for door swing clearance.",armoire:"24″ minimum in front for door swing clearance.",couch:"18″ clearance in front for walking past.",sofa:"18″ clearance in front for walking past.",bookshelf:"24″ in front for standing and browsing.",dresser:"24″ in front for opening drawers fully.",filing_cabinet:"24″ in front for opening drawers fully.",recliner:"18″ behind for full recline clearance.",china_cabinet:"24″ in front for opening glass doors safely."},d={FITS:'Tap "View" to see the room layout with walkway clearances.',FITS_TIGHT:'Tap "View" to see exactly how tight the clearances are.',FITS_VERY_TIGHT:'Tap "View" to see exactly how tight the clearances are.',DOESNT_FIT:'Tap "View" to see where the item exceeds the room.'},h={FITS_STRAIGHT:"**FITS** ✓\n\nYour {itemLength}{unit} {itemName} clears the {doorWidth}{unit} \xd7 {doorHeight}{unit} elevator door ({entryW}{unit} \xd7 {entryH}{unit} profile) and fits {orientationHint} inside the {cabWidth}{unit} \xd7 {cabDepth}{unit} \xd7 {cabHeight}{unit} cab{tiltNote}.\n\nTightest clearance: {tightestMargin}{unit} on {tightestAxis} ({tightestItemDim}{unit} item vs {tightestCabDim}{unit} {tightestCheckpoint}).\n\n{vizOffer}",FITS_TILTED:"**FITS** ✓\n\nYour {itemLength}{unit} {itemName} won't fit straight through the {doorWidth}{unit} door ({blockingDim}{unit} exceeds it by {excess}{unit}), but angling ~{tiltAngle}\xb0 clears the opening.\n\nTightest clearance: {tightestMargin}{unit} on {tightestAxis} ({tightestItemDim}{unit} item vs {tightestCabDim}{unit} {tightestCheckpoint}).\n\n{vizOffer}",FITS_TIGHT:"**TIGHT FIT** ✓\n\nYour {itemLength}{unit} {itemName}: {doorSummary} {cabSummary}\n\nTightest clearance: {tightestMargin}{unit} on {tightestAxis} ({tightestItemDim}{unit} item vs {tightestCabDim}{unit} {tightestCheckpoint}). Protect edges with moving blankets.\n\n{vizOffer}",VERY_TIGHT_STATIC:"**FITS — VERY TIGHT** ⚠️\n\nYour {itemLength}{unit} {itemName}: {doorSummary} {cabSummary}\n\nTightest clearance: {tightestMargin}{unit} on {tightestAxis} ({tightestItemDim}{unit} item vs {tightestCabDim}{unit} {tightestCheckpoint}) — less than 1″ before handrails, panels, or padding. Measure interior obstructions before attempting.\n\n{vizOffer}",VERY_TIGHT_ROTATION:"**FITS — VERY TIGHT** ⚠️\n\nYour {itemLength}{unit} {itemName} clears the {doorWidth}{unit} door, but rotating inside the cab is near the floor diagonal limit ({sweepDiagonal}{unit} item sweep vs {availableDiagonal}{unit} available). Margin: {rotationMargin}{unit} before real-world obstructions.\n\nMeasure handrail intrusion and remove elevator padding before attempting rotation.\n\n{vizOffer}",DOESNT_FIT_DOOR:"**DOESN'T FIT** ✕\n\nYour {itemLength}{unit} {itemName}'s {blockingDim}{unit} {tightestAxis} exceeds the {doorWidth}{unit} \xd7 {doorHeight}{unit} door opening by {excess}{unit} in the best orientation.{cabNote}\n\n{vizOffer}",DOESNT_FIT_DOOR_CLEARANCE:"**DOESN'T FIT** ✕\n\nYour {itemLength}{unit} {itemName} ({entryW}{unit} \xd7 {entryH}{unit} profile) has only {geoMargin}{unit} clearance at the {doorWidth}{unit} \xd7 {doorHeight}{unit} door — too tight for safe entry.{cabNote}\n\n{vizOffer}",DOESNT_FIT_CAB:"**DOESN'T FIT** ✕\n\nYour {itemLength}{unit} {itemName} clears the door, but exceeds the cab by {excess}{unit} on {cabLimitingAxis} ({cabLimitItemDim}{unit} item vs {cabLimitCabDim}{unit} cab). No orientation resolves this.\n\n{vizOffer}",MULTI_PIECE_UNKNOWN:"**NEEDS MORE INFO**\n\nYou mentioned the item in {pieceCount} pieces, but we need individual piece dimensions to check fit accurately. How does it split?\n\n• Symmetric halves (each ~{halfDims})\n• Different-sized sections\n• I'm not sure\n\nWithout piece dimensions, we'll assume worst case: each piece at full size ({fullDims})."},u={FITS:'Tap "View" to see the exact orientation and remaining clearance inside the elevator.',FITS_TILTED:'Tap "View" to see the entry angle and final placement.',FITS_TIGHT:'Tap "View" to see exact clearances at each checkpoint.',FITS_VERY_TIGHT:'Tap "View" to see exact clearances at each checkpoint.',DOESNT_FIT:'Tap "View" to see exactly where it fails.'},_={FITS:{summary:"Your {itemName} fits in the {space}
1 with {margin}{unit} to spare.",insight_access:"Loading through the {opening} leaves {openingMargin}{unit} of clearance (after 5% safety margin on opening).",insight_standard:"The tightest clearance is {margin}{unit} on the interior dimensions."},FITS_DIAGONAL:{summary:"Your {itemName} fits in the {space} diagonally — it won't fit straight.",insight:"Position it corner-to-corner at approximately {angle}\xb0 from the floor. Diagonal clearance: {margin}{unit}."},DOESNT_FIT:{summary:"Your {itemName} won't fit.",summary_blocked:"Your {itemName} won't fit.",insight:"The largest space ({space}) is {shortfall}{unit} too short. Checked all interior spaces and 6 axis-aligned orientations.",insight_blocked:"The {opening} opening is too narrow to load through. Checked all interior spaces and 6 axis-aligned orientations."},FITS_SEATS_FOLDED:{summary:"Your {itemName} fits — but only with the rear seats folded, which means no rear passengers.",insight:"With seats up, the {trunkLabel} is {shortfall}{unit} too short.",insight_default:"Folding the seats extends the available cargo length to accommodate your {itemName}."},FITS_TRUCK_BED:{summary:"Your {itemName} fits in the truck bed{tailgateNote}.",insight_overhang:"Secure the item with ratchet straps or tie-downs. Check local regulations for overhang limits.",insight_overhang_flag:"A red or orange flag is required for this much overhang in most US states. Secure the load with ratchet straps.",insight_standard:"Secure the item with ratchet straps or tie-downs."},DOESNT_FIT_ANY:{summary:"Your {itemName} won't fit.",insight:"Checked all interior spaces and 6 axis-aligned orientations."}},g={FITS:{summary:"Your {itemName} can navigate through the {spaceName} on the {carrierName}.",constraint:"Narrowest clearance: {margin}{unit} at {angle}\xb0 entry angle.",constraint_straight:"Narrowest clearance: {margin}{unit} — fits straight through.",motion_insight:"Approach at ~{angle}\xb0, advance through the opening while maintaining angle, then straighten on the far side.",motion_insight_straight:"Drive straight through — no angling needed."},FITS_TIGHT:{summary:"Your {itemName} can navigate through the {spaceName} on the {carrierName} — but it's tight.",constraint:"Only {margin}{unit} clearance at the tightest point — requires precise {angle}\xb0 entry angle.",constraint_straight:"Only {margin}{unit} clearance — tight even for straight-through passage.",motion_insight:"Approach at exactly ~{angle}\xb0. Advance slowly through the opening. {operatorNote} Verify clearances on-site before attempting.",motion_insight_straight:"Drive through slowly. {operatorNote} Verify clearances on-site before attempting."},DOESNT_FIT:{summary:"Your {itemName} cannot navigate through the {spaceName} on the {carrierName}.",constraint:"Even at the optimal angle ({angle}\xb0), the projection exceeds the opening by {excess}{unit}.",constraint_span:"Span ratio {spanRatio}:1 exceeds the practical limit — the object is too long relative to the opening.",constraint_vehicle:"The {carrierName} body ({vehicleWidth}{unit}) is wider than the opening ({spaceDim}{unit}).",motion_insight:"No rotation or maneuvering sequence resolves this. Consider: disassembly, alternative access route, or a wider opening."},UNKNOWN:{summary:"Cannot determine if your {itemName} can navigate through the {spaceName} on the {carrierName}.",constraint:"The motion path depends on {missingInfo} — provide these for a precise answer.",motion_insight:"Result assumes {assumptions}. Actual feasibility may differ — verify on-site."},CORNER_FITS:{summary:"Your {itemName} can navigate the corner on the {carrierName}.",constraint:"Corner clearance: {margin}{unit} (max navigable length: {maxLength}{unit}).",motion_insight:"Navigate slowly — the sweep geometry allows passage with the stated clearance."},CORNER_DOESNT_FIT:{summary:"Your {itemName} cannot navigate the corner on the {carrierName}.",constraint:"Max navigable length is {maxLength}{unit} — your item is {excess}{unit} too long.",motion_insight:"The corner sweep geometry doesn't allow passage. Consider: a wider corridor, disassembly, or carrying the item past the corner."}};var p=n(34699),f=n(58271),w=n(17192),v=n(7360),b=n(80051),y=n(92559),T=n(96848);function I(e,t){if("string"!=typeof e||!e)return e;let n=null==t?void 0:t.requestedContainerName;if(!n||!(/\d/.test(n)||/\b(pelican|nanuk|skb|seahorse|apache|monoprice|husky|dewalt|milwaukee|ridgid|otterbox)\b/i.test(n)))return e;let i=String(t.containerType||"container").toLowerCase(),a="I don't have interior dimensions for the ".concat(n,", so I assumed a generic ").concat(i,". ")+"For an exact answer, tell me its interior width \xd7 depth \xd7 height.";return"".concat(e,"\n\n").concat(a)}var M=n(89175),S=n(84849),k=n(20713);function N(e){var t,n,a,o,r,l,s,m,c,d,h,u,g,p,f,b,T,I,M;let S,N,x,E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((null==(t=E.allItemsData)?void 0:t.length)>1&&(null==e?void 0:e.perItemResults))return function(e){var t,n,a,o,r,l,s,m,c;let d,h,u,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:g="in",vehicleData:p,itemData:f,allItemsData:b,overrideSources:y}=_,T=(0,v.x)(g),I=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},T,{context:"prose",precision:"measurement"}),M=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},T,{context:"prose",precision:"measurement"}),S=e=>(0,w.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},T,{context:"prose",precision:"measurement"}),{verdict:k,margin_mm:N,perItemResults:x,jointPacking:E,allSpacesChecked:D,bestSpace:F,items:C}=e,O=(null==b?void 0:b.length)||(null==C?void 0:C.length)||0,R=null==D?void 0:D.find(e=>e.spaceKey===F),A=(null==R?void 0:R.label)||(null==E?void 0:E.label)||(null==F?void 0:F.replace(/_/g," "))||"cargo area",L="",P="",U=!1;if("DOESNT_FIT"===k){d="**DOES NOT FIT**";let e=null==x?void 0:x.every(e=>"DOESNT_FIT"!==e.verdict);if(h=e?"Each item fits individually, but all ".concat(O," together won't work — you'll need multiple trips or delivery."):"Not all ".concat(O," items fit in the ").concat(A," — you'll need a larger vehicle or delivery."),L="Short by ".concat(I(Math.abs(N||0)),"."),u="See what doesn't fit.",null==x?void 0:x.length){let e=[];for(let t=0;t<x.length;t++){let i=x[t],o=(null==b||null==(n=b[t])?void 0:n.name)||(null==C||null==(a=C[t])?void 0:a.name)||"Item ".concat(t+1);if("DOESNT_FIT"===i.verdict){let t=I(Math.abs(i.margin_mm||0));e.push("✗ **".concat(o,"** — too large by ").concat(t))}else e.push("✓ **".concat(o,"** — fits on its own"))}e.length>0&&(P+=e.join("\n"))}e&&(P+=(P?"\n\n":"")+"Consider making multiple trips or folding seats for more space.")}else{d="**FITS**",h="All ".concat(O," items fit together — you can take them home in one trip."),u="See how they're arranged.",(null==E?void 0:E.fillRatio)>.8&&(h+=" Pack carefully (".concat(Math.round(100*E.fillRatio),"% of space used)."));
1let e=null==E?void 0:E.clearancePerAxis;if(e){let t=[{label:"depth",clearance_mm:e.length_mm},{label:"width",clearance_mm:e.width_mm},{label:"height",clearance_mm:e.height_mm}].reduce((e,t)=>t.clearance_mm<e.clearance_mm?t:e);if(e.length_mm<0||e.width_mm<0||e.height_mm<0){U=!0;let n=[];e.length_mm<0&&n.push("depth by ".concat(I(-e.length_mm))),e.width_mm<0&&n.push("width by ".concat(I(-e.width_mm))),e.height_mm<0&&n.push("height by ".concat(I(-e.height_mm))),d="**DOES NOT FIT**",h="All ".concat(O," items together exceed the available space in the ").concat(A," — overflow on ").concat(n.join(", "),"."),L="Short by ".concat(I(Math.abs(t.clearance_mm))," in ").concat(t.label,"."),u="See what doesn't fit."}else L="Tightest clearance: ".concat(I(t.clearance_mm)," in ").concat(t.label,".")}else{let e=I(Math.abs(N||0));L="Tightest clearance: ".concat(e,".")}if(!U){if((null==E||null==(o=E.placements)?void 0:o.length)>0){let e=[];for(let t of[...E.placements].sort((e,t)=>e.originalIndex-t.originalIndex)){let n,i=t.originalIndex,a=(null==b||null==(r=b[i])?void 0:r.name)||(null==C||null==(l=C[i])?void 0:l.name)||"Item ".concat(i+1),o=t.orientation;if(!o)continue;let d=M(o.l),h=M(o.w),u=M(o.h),_=M((null==(s=t.position)?void 0:s.x)||0),g=M((null==(m=t.position)?void 0:m.y)||0),p=(null==(c=t.position)?void 0:c.z)||0;n=p<5?"at (".concat(_," along cargo, ").concat(g," across) on floor"):"stacked at (".concat(_," along cargo, ").concat(g," across), ").concat(M(p)," up"),e.push("• **".concat(a,"** — ").concat(d," along cargo \xd7 ").concat(h," across, ").concat(u," tall, ").concat(n))}e.length>0&&(P+="Arrangement (along cargo \xd7 across, from rear-left corner):\n"+e.join("\n"))}let e=null==E?void 0:E.clearancePerAxis,t=null==E?void 0:E.spaceUsed;if(e&&t){let n=[{label:"Depth",clearance_mm:e.length_mm,total_mm:t.length_mm},{label:"Width",clearance_mm:e.width_mm,total_mm:t.width_mm},{label:"Height",clearance_mm:e.height_mm,total_mm:t.height_mm}],i=n.reduce((e,t)=>t.clearance_mm<e.clearance_mm?t:e),a=n.map(e=>{let t=I(e.clearance_mm),n=S(e.total_mm),a=S(e.total_mm-e.clearance_mm),o=e===i?" ← tightest":"";return"• ".concat(e.label,": ").concat(t," remaining (").concat(n," available, ").concat(a," used)").concat(o)});P+=(P?"\n\n":"")+"Clearance:\n"+a.join("\n")}}}let H="";p&&b&&(H=(0,i.J3)(p,f,y,g,b));let W="".concat(d,"\n\n").concat(h,"\n\n").concat(L,"\n\n").concat(u),G=[];if(H&&G.push(H),P.trim()&&G.push(P.trim()),G.push("Measure your specific vehicle to confirm — cargo space and openings vary by model and year."),(null==(t=e.warnings)?void 0:t.length)>0&&"DOESNT_FIT"!==k&&!U)for(let t of e.warnings)G.push("Note: ".concat(t));return"".concat(W,"\n\n[details-below]\n\n").concat(G.join("\n\n"))}(e,E);let{userUnit:D="in",assumptions:F=[],vehicleData:C,itemData:O,overrideSources:R}=E;if(!e)return null;let{verdict:A,margin_mm:L,method:P,bestSpace:U,allSpacesChecked:H,diagonalDetails:W,accessConstraint:G,vehicleTypeId:q}=e;if("UNKNOWN"===A)return null;if((0,y.FB)(e),y.Fk&&e.tightestPoint){let t=(0,y.x2)(e,E);if(t)return t}let j=(0,v.x)(D),z=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},j,{context:"prose",precision:"measurement"}),V=z(Math.abs(L||0)),B=null==H?void 0:H.find(e=>e.spaceKey===U),Y=(null==B?void 0:B.label)||(null==U?void 0:U.replace(/_/g," "))||"cargo area";S="DOESNT_FIT"===A?U&&(null==H?void 0:H.length)>0?"DOESNT_FIT":"DOESNT_FIT_ANY":"truck_bed"===U?"FITS_TRUCK_BED":"diagonal"===P||"diagonal_tilted"===P?"FITS_DIAGONAL":(null==B?void 0:B.requiresSeatFolding)?"FITS_SEATS_FOLDED":"FITS";let K=(null==O?void 0:O.name)&&"your item"!==O.name&&"Item"!==O.name?O.name.toLowerCase():"item",$=(null==B?void 0:B.orientationLabel)?B.orientationLabel.toLowerCase():"",X="";if("FITS_DIAGONAL"===S?X=" diagonally":$&&"upright"!==$&&(X=" — placed ".concat($)),"DOESNT_FIT"===A)N=(null==H?void 0:H.length)>1?"Your ".concat(K," won't fit — you'll need delivery or a larger vehicle."):"Your ".concat(K," won't fit in the ").concat(Y," — you'll need delivery or a larger vehicle."),(null==(o=e.constraintViolation)?void 0:o.fitsWithout)&&(N+=" However, it fits ".concat(e.constraintViolation.unconstrainedOr
1ientationLabel,"."));else if("FITS_SEATS_FOLDED"===S)N=(0,k.Bi)(null==B?void 0:B.seatConfiguration)&&!0===(0,k.hy)(B.seatConfiguration)?"Your ".concat(K," fits — you can take it home, but only ").concat((0,k.vC)(B.seatConfiguration)).concat(X,"."):"Your ".concat(K," fits in the ").concat(Y).concat(X," — a layout recorded as needing seats folded, though which seats isn't confirmed for this vehicle.");else if("FITS_TRUCK_BED"===S){let e,t="";(null==B?void 0:B.tailgateState)==="tailgate_down"&&(t=(null==B?void 0:B.overhang_mm)>0?" — item extends ".concat((e=B.overhang_mm,(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},j,{context:"prose",precision:"measurement"}))," beyond the tailgate"):" with the tailgate lowered"),N="Your ".concat(K," fits in the truck bed").concat(t," — you can take it home today.")}else N="Your ".concat(K," fits in the ").concat(Y).concat(X," — you can take it home today.");let Q=function(e,t){var n;let{bestSpace:i,allSpacesChecked:a,method:o}=e;if("diagonal"===o||"diagonal_tilted"===o||"truck_bed"===i)return null;let r=null==a?void 0:a.find(e=>e.spaceKey===i),l=null==r?void 0:r.orientation;if(!l)return null;let s=null==t||null==(n=t.spaces)?void 0:n[i];if(!s)return null;let m=[];return(s.length_mm&&l.l&&m.push({label:"depth",clearance_mm:s.length_mm-l.l}),s.width_mm&&l.w&&m.push({label:"width",clearance_mm:s.width_mm-l.w}),s.height_mm&&l.h&&m.push({label:"height",clearance_mm:s.height_mm-l.h}),0===m.length)?null:m.reduce((e,t)=>t.clearance_mm<e.clearance_mm?t:e)}(e,C);if("DOESNT_FIT"===A)if(null==B?void 0:B.blocked){let e=(null==(r=B.blockedBy)?void 0:r.replace(/_/g," "))||"opening";x="Blocked by the ".concat(e,".")}else if(Q){let e=z(Math.abs(Q.clearance_mm));x=(null==H?void 0:H.length)>1?"Closest fit: ".concat(Y," — short by ").concat(e,"."):"Short by ".concat(e," in ").concat(Q.label,".")}else x=(null==H?void 0:H.length)>1?"Closest fit: ".concat(Y," — short by ").concat(V,"."):"Short by ".concat(V,".");else if(null==G?void 0:G.isBottleneck){let e=(null==(l=G.opening)?void 0:l.replace(/_/g," "))||"opening",t=z(G.margin_mm);x="Tightest clearance: ".concat(t," at the ").concat(e," (after 5% safety margin).")}else x=Q?"Tightest clearance: ".concat(z(Q.clearance_mm)," in ").concat(Q.label,"."):"Tightest clearance: ".concat(V,".");let J="";C&&O&&(J=(0,i.J3)(C,O,R,D));let Z="",ee=_[S];switch(S){case"FITS":if(null==G?void 0:G.isBottleneck){let e=(null==(s=G.opening)?void 0:s.replace(/_/g," "))||"opening",t=z(G.margin_mm);Z=ee.insight_access.replace(/{opening}/g,e).replace(/{openingMargin}/g,t)}else Z=ee.insight_standard;break;case"FITS_DIAGONAL":{let e=(null==W?void 0:W.angle_deg)||"?";Z=ee.insight.replace(/{angle}/g,e);break}case"FITS_SEATS_FOLDED":{let e=null==H?void 0:H.find(e=>!e.requiresSeatFolding&&!e.fits&&"truck_bed"!==e.spaceKey);if(e){let t=z(Math.abs(e.margin_mm)),n=e.label||(null==(m=e.spaceKey)?void 0:m.replace(/_/g," "))||"trunk";Z=ee.insight.replace(/{trunkLabel}/g,n).replace(/{shortfall}/g,t)}else Z=ee.insight_default;break}case"FITS_TRUCK_BED":if((null==B?void 0:B.overhang_mm)>0&&(null==B?void 0:B.needsFlag))Z=ee.insight_overhang_flag;else if((null==B?void 0:B.overhang_mm)>0)Z=ee.insight_overhang;else if((null==B?void 0:B.tailgateState)==="tailgate_up"&&"straight"===P){let e=B.bestFitLengthMargin_mm,t=B.bestFitWidthMargin_mm,n=z(null!=(c=B.margin_mm)?c:0);Z=null!=e&&null!=t&&t<e?"▸ Tailgate closed: fits — ".concat(n," clearance between wheel wells, ").concat(z(e)," lengthwise."):"▸ Tailgate closed: fits — ".concat(n," clearance."),(null!=(d=B.margin_mm)?d:1/0)<51&&(Z+=" Minimal clearance — measure your specific truck bed to confirm.")}else if((null==B?void 0:B.tailgateState)==="tailgate_up"&&("diagonal"===P||"diagonal_tilted"===P)){let e=B.tailgateUpStraightLengthMargin_mm,t=z(null!=e?Math.abs(e):Math.abs(null!=(h=B.tailgateUpStraightMargin_mm)?h:0)),n=z(null!=(u=B.margin_mm)?u:0),i=null!=(g=B.tailgateUpDiagonalAngle)?g:"?";Z="▸ Tailgate closed: ".concat(t," too long for straight placement. Fits at ~").concat(i,"\xb0 angle — ").concat(n," clearance."),(null!=(p=B.margin_mm)?p:1/0)<51&&(Z+=" Minimal clearance — measure your specific truck bed to confirm.")}else if((null==B?void 0:B.tailgateState)==="tailgate_down"){let e=B.tailgateUpStraightLengthMargin_mm,t=z(null!=e?Math.abs(e):Math.abs(null!=(f=B.tailgateUpStraightMargin_mm)?f:0)),n=B.bestFitLengthMargin_mm,i=B.bestFitWidthMargin_mm,a=z(null!=(b=B.margin_mm)?b:0);Z="▸ Tailgate closed: ".concat(t," too long."),null!=n&&null!=i&&i<n?Z+="\n▸ Tailgate down: fits — ".concat(z(n)," lengthwise, ").concat(a," between wheel wells."):Z+="\n▸ Tailgate down: fits — ".concat(a," clearance."),(null!=(T=B.margin_mm)?T:1/0)<51&&(Z+=" Minimal clearance — measure your specific truck bed to confirm.")}else Z=ee.insight_standard;break;case"DOESNT_FIT":{let e=B||(null==H?void 0:H.reduce((e,t)=>
1{var n;return t.margin_mm>(null!=(n=null==e?void 0:e.margin_mm)?n:-1/0)?t:e},null)),t=(null==e?void 0:e.label)||(null==e||null==(I=e.spaceKey)?void 0:I.replace(/_/g," "))||"largest space";if(null==e?void 0:e.blocked){let t=(null==(M=e.blockedBy)?void 0:M.replace(/_/g," "))||"opening";Z=ee.insight_blocked.replace(/{opening}/g,t)}else Z=ee.insight.replace(/{space}/g,t).replace(/{shortfall}/g,V);break}case"DOESNT_FIT_ANY":Z=ee.insight;break;default:return null}Z=Z.replace(/{itemName}/g,K).replace(/{space}/g,Y).replace(/{margin}/g,V).replace(/{unit}/g,"");let et=null==(n=e.assumptions)?void 0:n.find(e=>/as requested/i.test(e)),en=et?"*".concat(et,"*"):"",ei=["DOESNT_FIT"===A?"**DOES NOT FIT**":"**FITS**",N];en&&ei.push(en),ei.push(x,"DOESNT_FIT"===A?"See what was checked.":"See how it fits.");let ea=ei.join("\n\n"),eo=[];if(J&&eo.push(J),Z&&eo.push(Z),eo.push("Measure your specific vehicle to confirm — cargo space and openings vary by model and year."),"MEDIUM"===e.confidence&&F.length>0&&(eo[eo.length-1]+=" (".concat(F[0],")")),(null==(a=e.warnings)?void 0:a.length)>0&&"DOESNT_FIT"!==A)for(let t of e.warnings)eo.push("Note: ".concat(t));return"".concat(ea,"\n\n[details-below]\n\n").concat(eo.join("\n\n"))}var x=n(56381);let E={fits:"Fits based on listed piece dimensions",tight:"Tight — verify before buying",does_not_fit:"Does not fit based on listed piece dimensions",cannot_verify:"Cannot verify — missing piece dimensions"};var D=n(19817);function F(e,t){return(0,D.c)(e,{approximate:!t})}function C(e,t){return null==e||Number.isNaN(e)?"—":"cm"===t||"mm"===t||"m"===t?"".concat((.0283168*e).toFixed(1)," m\xb3"):"".concat(Math.round(e).toLocaleString()," ft\xb3")}function O(e){let t=null==e?void 0:e.basis;if(!t)return"move";if("checklist"===t.tier&&Array.isArray(t.rooms)&&t.rooms.length)return"".concat(t.rooms.join(", ")," move");if("item_list"===t.tier)return"list of items";if("bedrooms"===t.tier){let e=t.dwelling;if("studio"===e)return"studio move";let n=Number.isFinite(t.bedrooms)&&t.bedrooms>=1?"".concat(t.bedrooms>=4?"4+":t.bedrooms,"-bedroom "):"";return"".concat(n).concat(e&&"studio"!==e?"".concat(e," "):"","move").replace(/\s+/g," ").trim()}return"move"}function R(e){let t=Array.isArray(e.ranked)?e.ranked:[],{recommended:n,band:i}=e;return t.map(e=>({classId:e.classId,label:e.label,family:e.family,usableCubicFt:e.usableCubicFt,rawCubicFt:e.rawCubicFt,headroomPct:(null==i?void 0:i.expected)?Math.round((e.usableCubicFt-i.expected)/i.expected*100):null,isRecommended:!!(n&&e.classId===n.classId),tradeoff:n&&e.classId===n.classId?"Recommended":(null==i?void 0:i.expected)!=null&&e.usableCubicFt<i.expected?"Too small":n&&e.usableCubicFt>n.usableCubicFt?"One size up — more headroom":"Also fits"}))}function A(e,t){let{verdict:n,band:i,recommended:a,alternative:o,multiLoad:r}=e,l=O(i),s=null==i?void 0:i.expected;switch(n){case"FITS":return"A **".concat(a.label,"** fits a typical ").concat(l)+" — about ".concat(C(s,t)," of stuff, with room to spare (").concat(C(a.usableCubicFt,t)," usable).");case"TIGHT_FIT":return"A **".concat(a.label,"** fits your ").concat(l,", but it'll be tight")+(o?" — size up to a **".concat(o.label,"** (").concat(C(o.usableCubicFt,t)," usable) for breathing room."):" — it's the largest single option, so a fuller-than-average home may need a second load.");case"DOESNT_FIT":{var m;let e=null==r?void 0:r.baseClass,n=null!=(m=null==r?void 0:r.loads)?m:2,i=null==r?void 0:r.overflowCubicFt,a="Your ".concat(l," is bigger than a single **").concat((null==e?void 0:e.label)||"unit","**");return a+=" — plan on about **".concat(n," loads**"),null!=i&&i>0?a+=" (the largest unit plus ~".concat(C(i,t)," of overflow)."):a+=" of the largest unit.",a}case"UNKNOWN":{let e=C(null==i?void 0:i.low,t),n=C(null==i?void 0:i.high,t),a=C(s,t);return"Rough estimate: a ".concat(l," runs about ").concat(e,"–").concat(n," (≈").concat(a," typical). ")+"Tell me the bedroom count or list the big items and I'll pin a size."}default:return"To size a truck, POD, or storage unit, tell me how many bedrooms you're moving — or list the main items you're taking."}}var L=n(14951),P=n(71918);let U={estimated_approved:{en:"The store's size for this item is an estimate",es:"La medida que da la tienda para este art\xedculo es una estimaci\xf3n"},package_fallback:{en:"The store's size for this item is its box size",es:"La medida que da la tienda para este art\xedculo es la de su caja"},description_parse:{en:"The store's size for this item was read from its description",es:"La medida de este art\xedculo se tom\xf3 de la descripci\xf3n de la tienda"},store_field_unreviewed:{en:"The store hasn't confirmed this item's size yet",es:"La tienda a\xfan no ha confirmado la medida de este art\xedculo"}},H={en:", and the fit is too close to call. Measure the item or ask the store for its exact size.",es:" y el ajuste es demasiado justo para saberlo. Mide el art\xedculo o pide a la tienda su medida exacta."};function W(e){var t,n,_,k,W,G,q,j,z,V,B,Y;let K,$,X,Q,J,Z=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:ee="in",queryType:et="passage",assumptions:en=[],dimensionSource:ei="default"}=Z;if((null==e?void 0:e.verdict)==="INSUFFICIENT_CERTAINTY"){let t=null!=(W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if(!e||!Object.prototype.hasOwnProperty.call(U,e))return null;let n="es"===t?"es":"en";return U[e][n]+H[n]}(e.dimsConfidence,"en"))?W:"Verify measurements before relying on this result.",{icon:n,headline:i}=(0,M.M$)("INSUFFICIENT_CERTAINTY");return"**".concat(n," ").concat(i,"**\n\n").concat(t)}if("container_fit"===et||"container"===et||(null==e?void 0:e.queryType)==="container_fit")return function(e){var t;let n,a,o,s,m,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:d="cm",assumptions:h=[],dimensionSource:u="default"}=c;if(!e)return null;if((0,y.FB)(e),y.Fk&&e.tightestPoint&&"CLARIFY"!==e.verdict&&"UNKNOWN"!==e.verdict){let t=(0,y.ie)(e,{userUnit:d,assumptions:h,dimensionSource:u});if(t)return I(t,e)}let{verdict:_,margin_mm:g,details:f,needs_user_input:T,method:M}=e,S=(0,v.x)(d),k=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},S,{context:"prose",precision:"measurement"}),N=k(g||0),x=k(g||0),E=(null==f?void 0:f.item_count)||(null==(t=e.checked_orientations)?void 0:t.length)||1;if("CLARIFY"===_||"UNKNOWN"===_){let e=T||[],t=e.length>0?e.slice(0,2).join("; "):"some dimensions are missing",n=e.filter(e=>e.includes("height")||e.includes("thickness")||e.includes("length")||e.includes("width")).map(e=>e.includes("height")||e.includes("thickness")?"thickness/height":e.includes("length")?"length":e.includes("width")?"width":e).filter((e,t,n
1)=>n.indexOf(e)===t).join(" and ")||"complete dimensions",i=(o=r.CLARIFY.missingDims).replace(/{missingInfo}/g,t).replace(/{missingDimensions}/g,n);return i+(" "+p.CG)}if("FITS_VERY_TIGHT"===_)o=E>1?r.FITS_VERY_TIGHT.multiple:r.FITS_VERY_TIGHT.single,s=l.FITS_VERY_TIGHT;else if("FITS"===_){let e=null==f?void 0:f.strategy;o=E>1&&e?r.FITS.stacked:E>1?r.FITS.multiple:r.FITS.single,s=l.FITS}else if("FITS_TIGHT"===_)o=E>1?r.FITS_TIGHT.multiple:r.FITS_TIGHT.single,s=l.FITS_TIGHT;else if("FITS_WONT_CLOSE"===_){let t=e.closureType||"lid",n=e.closureDetail;o="clamshell"===t&&n?r.FITS_WONT_CLOSE.clamshell:"lid"===t?r.FITS_WONT_CLOSE.lid:r.FITS_WONT_CLOSE.single,s=l.FITS_WONT_CLOSE}else if("LIKELY_FITS"===_)o=r.LIKELY_FITS.standard,s=l.LIKELY_FITS;else if("LIKELY_DOESNT_FIT"===_)o=(null==f?void 0:f.closest_strategy)?r.LIKELY_DOESNT_FIT.withStrategy:r.LIKELY_DOESNT_FIT.standard,s=l.LIKELY_DOESNT_FIT;else{if("DOESNT_FIT"!==_)return null;o=(null==f?void 0:f.volumeExceeded)?r.DOESNT_FIT.volume:E>1?r.DOESNT_FIT.multiple:(null==f?void 0:f.limiting_dimension)?r.DOESNT_FIT.dimension:r.DOESNT_FIT.single,s=l.DOESNT_FIT}let D=(null==f?void 0:f.strategy)?p.IS[f.strategy]||f.strategy:"",F=(null==f?void 0:f.limiting_dimension)||e.limiting_constraint||"dimension",C=(null==f?void 0:f.container_limiting_dimension)||"dimension",O=(e.parsedItems||[]).map(e=>e.name).filter(Boolean),R=O.length>0?1===O.length?O[0]:O.slice(0,-1).join(", ")+" and "+O[O.length-1]:"Item",A="Item"===R?"the item":R,L="".concat(R," fits with ").concat(N," clearance");if(null==f?void 0:f.margins){let t=f.margins,n=e.limiting_constraint||(0,i.Vx)(t);L="".concat(R," fits with ").concat(N," to spare (tightest on ").concat(n,")")}let P="".concat(R," exceeds container by ").concat(x);if(null==f?void 0:f.violations){let e=Object.entries(f.violations).filter(e=>{let[,t]=e;return t>0}).map(e=>{let[t,n]=e;return"".concat(k(n)," too ").concat("height"===t?"tall":"width"===t?"wide":"long")});e.length>0&&(P="".concat(R," is ").concat(e.join(", ")))}else(null==f?void 0:f.reason)&&(P=f.reason);let U=h.length>0?"Note: ".concat(h[0]):"Verify dimensions for certainty.",H=e.closureDetail,W=H?(n=H.itemDim_mm,(0,w.ix)({mm:null!=n?n:0,role:"item-dimensions",source:"solver"},S,{context:"prose",precision:"measurement"})):x,G=H?(a=H.halfDepth_mm,(0,w.ix)({mm:null!=a?a:0,role:"space-dimensions",source:"solver"},S,{context:"prose",precision:"measurement"})):"?",q=H?k(H.excess_mm):x,j="clamshell"===e.closureType?"suitcase halves":"lid",z=e.containerName||e.containerType||"container",V=o.replace(/{margin}/g,N).replace(/{excess}/g,H?q:x).replace(/{unit}/g,"").replace(/{itemCount}/g,E).replace(/{strategy}/g,D).replace(/{limitingDim}/g,F).replace(/{containerDim}/g,C).replace(/{clearanceDetail}/g,L).replace(/{failDetail}/g,P).replace(/{caveat}/g,U).replace(/{reason}/g,e.reason||"Dimensions are incomplete").replace(/{itemDim}/g,W).replace(/{halfDepth}/g,G).replace(/{containerName}/g,z).replace(/{closureDesc}/g,j).replace(/{itemLabel}/g,R).replace(/{itemLabelLower}/g,A),B=z.toLowerCase();if(/carry[\s-]?on|suitcase|luggage|cabin\s?bag/i.test(B)||/carry[\s-]?on|suitcase|luggage|cabin\s?bag/i.test(R)){let e=V.split("\n\n");e.length>=2&&("FITS"===_||"FITS_TIGHT"===_||"LIKELY_FITS"===_?e[1]=e[1].replace(/\.$/," — it qualifies as carry-on."):("DOESNT_FIT"===_||"LIKELY_DOESNT_FIT"===_)&&(e[1]=e[1].replace(/\.$/," — you'll need to check it.")),V=e.join("\n\n"))}if(V+="\n\n"+s,"MEDIUM"===e.confidence&&h.length>0&&(V+=" (".concat(h[0],")")),"room_scan"===u&&("FITS_TIGHT"===_||"FITS_VERY_TIGHT"===_)&&(V+=' Scan measurements have \xb11-2" tolerance — consider measuring the tightest dimension manually.'),e.dual_interpretation&&e.interpretation){let t="container"===e.interpretation?"fitting inside":"fitting through",n="container"===e.interpretation?"fitting through an opening":"fitting inside a container";V+="\n\nWe interpreted this as ".concat(t,". If you meant ").concat(n,", try rephrasing your query.")}let Y=(0,b.el)(e,{userUnit:d,queryType:"container",itemName:R,spaceName:z});if(V+="\n\n[details-below]\n\n",(m=Y&&!Y.includes("Proof unavailable")?[Y]:[(0,p.qc)("container",e,{userUnit:d,itemName:R,dimensionSource:u}),(0,p.li)(e.checked_orientations,d,{queryType:"container"}
1),Y].filter(Boolean)).length>0)V+=m.join("\n\n");else{let t=k(e.margin_mm||0);V+="**Calculation Summary**\nVerdict: ".concat(e.verdict,"\nMargin: ").concat(t)}return I(V,e)}(e,{userUnit:ee,assumptions:en,dimensionSource:ei});if("catalog_fit_recommendation"===et||(null==e?void 0:e.queryType)==="catalog_fit_recommendation")return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{category:n,threshold_mm:i,guidance:a,candidates:o}=e||{},r=t.userUnit,l=[],s=null!=i?function(e,t){let n=(0,v.x)(t||"in");return(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},n,{context:"prose",precision:"rough"})}(i,r):null;if(l.push("I can filter known ".concat(n," models by doorway clearance.")),s&&l.push("For this doorway, prioritize ".concat(n,"s where each carried piece has a shortest rigid dimension under ~").concat(s,".")),a&&l.push(a),l.push(""),!Array.isArray(o)||0===o.length)return l.push("_I don't have curated catalog data for this category yet — the guidance above is geometry-based and always correct._"),l.join("\n");let m={fits:0,tight:1,does_not_fit:2,cannot_verify:3},c=[...o].sort((e,t)=>{var n,i;return(null!=(n=m[e.verdict])?n:99)-(null!=(i=m[t.verdict])?i:99)});for(let e of(l.push("| Model | Retailer | Verdict |"),l.push("|---|---|---|"),c)){let t=e.url?"[".concat(e.product_name,"](").concat(e.url,")"):e.product_name||"Unknown",n=e.retailer||"—",i=E[e.verdict]||E.cannot_verify;l.push("| ".concat(t," | ").concat(n," | ").concat(i," |"))}return l.join("\n")}(e,{userUnit:ee});if("inventory_fit"===et||(null==e?void 0:e.queryType)==="inventory_fit")return(0,L.X)(e)||null;if("elevator"===et||(null==e?void 0:e.queryType)==="elevator"){let t=null==e?void 0:e.parsedElevatorItem;return function(e){var t,n,i,a,o,r,l,s,m;let c,d,_,g,f,I,M=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:S="in",assumptions:k=[],itemName:N="item",itemLength_mm:x=null,dimensionSource:E="default"}=M;if(!e)return null;if((0,y.FB)(e),y.Fk&&e.tightestPoint&&"UNKNOWN"!==e.verdict&&!(null==(i=e.needs_user_input)?void 0:i.includes("piece_split_type"))){let t=(0,y.bF)(e,{userUnit:S,itemName:N,dimensionSource:E,assumptions:k});if(t)return t}let{verdict:D,doorClearance:F,cabClearance:C,rotationClearance:O,tightestConstraint:R,tightestMargin_mm:A,needs_user_input:L}=e;if("UNKNOWN"!==D&&(!F||!C))return null;let P=(0,v.x)(S),U=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},P,{context:"prose",precision:"measurement"}),H=e=>(0,w.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"solver"},P,{context:"prose",precision:"measurement"}),W=e=>(0,w.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},P,{context:"prose",precision:"measurement"}),G=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},P,{context:"prose",precision:"measurement"});if(null==L?void 0:L.includes("piece_split_type")){let t=e.pieceCount||2,n=e.bestOrientation,i="?",a="?";if(n){let e=G(n.across_door_mm),t=G(n.along_depth_mm),o=G(n.vertical_mm);i="".concat(e,"\xd7").concat(t,"\xd7").concat(o),a="".concat(G(n.across_door_mm/2),"\xd7").concat(t,"\xd7").concat(o)}return h.MULTI_PIECE_UNKNOWN.replace(/{pieceCount}/g,t).replace(/{fullDims}/g,i).replace(/{halfDims}/g,a)}if("UNKNOWN"===D)return null;if("DOESNT_FIT"===D)c="door"===R?(null==F?void 0:F.geometric_margin_mm)!=null&&F.geometric_margin_mm>=0?h.DOESNT_FIT_DOOR_CLEARANCE:h.DOESNT_FIT_DOOR:h.DOESNT_FIT_CAB,d=u.DOESNT_FIT;else if("FITS_VERY_TIGHT"===D)c="rotation"===R?h.VERY_TIGHT_ROTATION:h.VERY_TIGHT_STATIC,d=u.FITS_VERY_TIGHT;else if("FITS_TIGHT"===D)c=h.FITS_TIGHT,d=u.FITS_TIGHT;else if("FITS_TILTED"===D||(null==F?void 0:F.method)==="tilted"||(null==F?void 0:F.method)==="diagonal")c=h.FITS_TILTED,d=u.FITS_TILTED;else{if("FITS"!==D)return null;c=h.FITS_STRAIGHT,d=u.FITS}let q=F?H(F.doorWidth_mm):"?",j=F?H(F.doorHeight_mm):"?",z=F?U(Math.abs(F.margin_mm)):"?",V=(null==F?void 0:F.geometric_margin_mm)!=null?U(F.geometric_margin_mm):"?",B=(null==C?void 0:C.effectiveDimensions)||{},Y=B.width_mm?W(B.width_mm):"?",K=B.depth_mm?W(B.depth_mm):"?",$=B.height_mm?W(B.height_mm):"?",X=(null==C?void 0:C.margin_mm)!=null?U(Math.abs(C.margin_mm)):"?",Q=(null==C?void 0:C.limitingAxis)||"dimension",J=(null==C?void 0:C.perAxisMargins)||{},Z=U(Math.abs(null!=(a=J.width_mm)?a:0)),ee=U(Math.abs(null!=(o=J.depth_mm)?o:0)),et=U(Math.abs(null!=(r=J.height_mm)?r:0)),en="?",ei="?";if((null==C?void 0:C.limitingAxis)&&B){let e=B[C.limitingAxis+"_mm"],t=null!=e?e-(null!=(l=C.margin_mm)?l:0):null;null!=e&&(ei=W(e)),null!=t&&(en=G(t))}let ea=e.bestOrientation,eo=ea?G(ea.across_door_mm):"?",er=ea?G(ea.vertical_mm):"?",el="";if(ea){let e=Math.max(ea.across_door_mm,ea.vertical_mm,ea.along_depth_mm);el=ea.along_depth_mm===e?"lengthwise":ea.vertical_mm===e?"upright":"widthwise"}let es="?",em="?";"cab"===R||"entry_depth"===R?(es=en,em=ei):"door"===R?(null==F?void 0:F.limitingDimension)==="height"?(es=ea?G(ea.vertical_mm):"?",em=j):(es=ea?G(ea.across_door_mm):"?",em=q):"rotation"===R&&(es=(null==O?void 0:O.sweepDiagonal_mm)?G(O.sweepDiagonal_mm):"?",em=(null==O?void 0:O.availableDiagonal_mm)?W(O.availableDiagonal_mm):"?");let ec=null!=(s=null==F?void 0:F.tiltAngle_deg)?s:"?";_=(null==F?void 0:F.limitingDimension)==="height"&&(null==ea?void 0:ea.vertical_mm)?G(ea.vertical_mm):(null==F?void 0:F.limitingDimension)==="width"&&(null==ea?void 0:ea.across_door_mm)?G(ea.across_door_mm):(null==F?void 0:F.limitingDimension)!=null&&"number"==typeof F.limitingDimension?G(F.limitingDimension):((null==F?void 0:F.method)==="diagonal"||(null==F?void 0:F.method)==="tilted")&&(null==ea?void 0:ea.across_door_mm)?G(ea.across_door_mm):"?",g=U(((null==F?void 0:F.method)==="diagonal"||(null==F?void 0:F.method)==="tilted")&&(null==(t=e.bestOrientation)?void 0:t.across_door_mm)&&(null==F?void 0:F.doorWidth_mm)?Math.abs(e.bestOrientation.across_door_mm-F.doorWidth_mm):"door"===R&&(null==F?void 0:F.geometric_margin_mm)!=null&&F.geometric_margin_mm<0?Math.abs(F.geometric_margin_mm):Math.abs(A||0));let ed=U(Math.abs(A||0));f="door"===R?(null==F?void 0:F.limitingDimension)||"door":"rotation"===R?"rotation sweep":(null==C?void 0:C.limitingAxis)||"dimension";let eh=(null==O?void 0:O.sweepDiagonal_mm)?G(O.sweepDiagonal_mm):"?",eu=(null==O?void 0:O.availableDiagonal_mm)?W(O.availableDiagonal_mm):"?",e_=(null==O?void 0:O.margin_mm)!=null?U(Math.abs(O.margin_mm)):"?",eg=function(e,t,n){if(!e)return"";let i=t(Math.abs(e.margin_mm)),a=n(e.doorWidth_mm),o=e.doorHeight_mm?n(e.doorHeight_mm):null,r=o?"".concat(a," \xd7 ").concat(o):"".concat(a);return"tilted"===e.method?"Door: angled ~".concat(e.tiltAngle_deg,"\xb0 through the ").concat(r," opening (").concat(i," clearance)."):"diagonal"===e.method?"Door: diagonal entry through the ".concat(r," opening (").concat(i," clearance)."):"Door: clears the ".concat(r," opening (").concat(i," ").concat(e.limitingDimension||""," clearance).")}(F,U,H),ep=function(e,t){if(!e)return"";let n=t(Math.abs(e.margin_mm)),i=e.limitingAxis||"dimension";return"Cab: ".concat(n," clearance on the tightest axis (").concat(i,").")}(C,U),ef=(null==(m=e.warnings)?void 0:m.length)>0?e.warnings[0]:"Consider a freight elevator, disassembly, or a smaller alternative.",ew=N.toLowerCase(),ev=x?G(x):"?",eb=(null==F?void 0:F.method)==="straight"?" without tilting":"",ey=(e.assumptions||[]).some(e=>/standard.*cab/i.test(e)),eT=(null==C?void 0:C.fits)&&!ey?" The cab interior is large enough, but entry is blocked.":"",eI=c.replace(/{doorWidth}/g,q).replace(/{doorHeight}/g,j).replace(/{doorMargin}/g,z).replace(/{geoMargin}/g,V).replace(/{cabNote}/g,eT).replace(/{cabWidth}/g,Y).replace(/{cabDepth}/g,K).replace(/{cabHeight}/g,$).replace(/{cabMargin}/g,X).replace(/{cabLimitingAxis}/g,Q).replace(/{cabWidthMargin}/g,Z).replace(/{cabDepthMargin}/g,ee).replace(/{cabHeightMargin}/g,et).replace(/{cabLimitItemDim}/g,en).replace(/{cabLimitCabDim}/g,ei).replace(/{entryW}/g,eo).replace(/{entryH}/g,er).replace(/{orientationHint}/g,el).replace(/{tightestItemDim}/g,es).replace(/{tightestCabDim}/g,em).replace(/{tiltAngle}/g,ec).replace(/{blockingDim}/g,_).replace(/{excess}/g,g).replace(/{tightestMargin}/g,ed).replace(/{tightestAxis}/g,f).replace(/{tightestCheckpoint}/g,R||"cab").replace(/{sweepDiagonal}/g,eh).replace(/{availableDiagonal}/g,eu).replace(/{rotationMargin}/g,e_).replace(/{doorSummary}/g,eg).replace(/{cabSummary}/g,ep).replace(/{suggestion}/g,ef).replace(/{vizOffer}/g,d).replace(/{itemName}/g,ew).replace(/{itemLength}/g,ev).replace(/{tiltNote}/g,eb).replace(/{unit}/g,"");"MEDIUM"===e.confidence&&k.length>0&&(eI+=" (".concat(k[0],")")),(null==(n=e.warnings)?void 0:n.length)>0&&(eI+="\n\nNote: ".concat(e.warnings[0]));let eM=(0,b.el)(e,{userUnit:S,queryType:"elevator",itemName:N,spaceName:"Elevator"});if(eI+="\n\n[details-below]\n\n",(I=eM&&!eM.includes("Proof unavailable")?[eM]:[(0,p.qc)("elevator",e,{userUnit:S,itemName:N,dimensionSource:E}),(0,p.li)(e.checked_orientations,S,{queryType:"elevator"}
1),eM].filter(Boolean)).length>0)eI+=I.join("\n\n");else{let t=U(e.margin_mm||0);eI+="**Calculation Summary**\nVerdict: ".concat(e.verdict,"\nMargin: ").concat(t)}return"".concat(eI,"\n\n").concat(T.p)}(e,{userUnit:ee,assumptions:en,dimensionSource:ei,itemName:(null==t?void 0:t.name)||"item",itemLength_mm:t?Math.max(t.width_mm||0,t.depth_mm||0,t.height_mm||0):null})}if("vehicle"===et||(null==e?void 0:e.queryType)==="vehicle")return N(e,{userUnit:ee,assumptions:en,vehicleData:e.vehicleData||null,itemData:e.parsedVehicleItem||null,overrideSources:e.overrideSources||null});if("motion"===et||(null==e?void 0:e.queryType)==="motion")return function(e){var t,n,i,a;let o,r,l,s,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:c="in",assumptions:d=[],dimensionSource:h="default"}=m;if(!e)return null;let{verdict:u,margin_mm:_,method:p,confidence:f,motion_advisory:b,equipment_used:T,environment:I}=e;if("UNKNOWN"===u&&!b)return null;if((0,y.FB)(e),y.Fk&&e.tightestPoint&&"UNKNOWN"!==u){let t=(0,y.fH)(e,{userUnit:c,assumptions:d,dimensionSource:h});if(t)return t}let k=(0,v.x)(c),N=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},k,{context:"prose",precision:"measurement"}),x=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},k,{context:"prose",precision:"measurement"}),E=N(Math.abs(_||0)),D=N(Math.abs(_||0)),F=(null==T?void 0:T.label)||"equipment",C="corner_turn"===p||"u_turn"===p?"corner":"opening",O=null==b?void 0:b.required_angle_deg,R=null==b?void 0:b.maneuver_difficulty,A=null==b?void 0:b.span_ratio,L="corner_turn"===p||"u_turn"===p,P="straight"===p;(null==T?void 0:T.resolution)==="class_template"||null==T||T.resolution;let U=R&&M.Xk[R]||"";if("FITS"===u)o="**FITS** ✓";else if("FITS_TIGHT"===u)o="**TIGHT FIT** ✓";else if("DOESNT_FIT"===u)o="**DOESN'T FIT** ✕";else{if("UNKNOWN"!==u)return null;o="**NEEDS MORE INFO** ✕"}if(L){let t=null==(i=e._motion)?void 0:i.cornerMaxLength_mm,n=t?x(t):"?";if("FITS"===u||"FITS_TIGHT"===u){let e=g.CORNER_FITS;r=e.summary.replace(/{itemName}/g,"item").replace(/{carrierName}/g,F),l=e.constraint.replace(/{margin}/g,E).replace(/{unit}/g,"").replace(/{maxLength}/g,n),s=e.motion_insight}else{let e=g.CORNER_DOESNT_FIT;r=e.summary.replace(/{itemName}/g,"item").replace(/{carrierName}/g,F),l=e.constraint.replace(/{maxLength}/g,n).replace(/{excess}/g,D).replace(/{unit}/g,""),s=e.motion_insight}}else if("UNKNOWN"===u){let t=g.UNKNOWN,n=[];_||0===_||n.push("complete dimensions"),(null==T?void 0:T.resolution)==="default"&&n.push("specific equipment type");let i=n.length>0?n.join(" and "):"additional measurements",a=(e.assumptions||[]).slice(0,2).join("; ")||"default equipment dimensions";r=t.summary.replace(/{itemName}/g,"item").replace(/{spaceName}/g,C).replace(/{carrierName}/g,F),l=t.constraint.replace(/{missingInfo}/g,i),s=t.motion_insight.replace(/{assumptions}/g,a)}else{let t=g[u];if(!t)return null;if(r=t.summary.replace(/{itemName}/g,"item").replace(/{spaceName}/g,C).replace(/{carrierName}/g,F),"DOESNT_FIT"===u){if(A&&A>S.U.span.MOTION_REQUIRED)l=t.constraint_span.replace(/{spanRatio}/g,A.toFixed(1));else if(null!=_&&(null==T?void 0:T.width_mm)){let n=x(T.width_mm);l=(null==(a=e.assumptions)?void 0:a.some(e=>/body.*wider|wider.*body/i.test(e)))?t.constraint_vehicle.replace(/{carrierName}/g,F).replace(/{vehicleWidth}/g,n).replace(/{unit}/g,"").replace(/{spaceDim}/g,"?"):t.constraint.replace(/{angle}/g,null!=O?O:"?").replace(/{excess}/g,D).replace(/{unit}/g,"")}else l=t.constraint.replace(/{angle}/g,null!=O?O:"?").replace(/{excess}/g,D).replace(/{unit}/g,"");s=t.motion_insight}else l=t[P?"constraint_straight":"constraint"].replace(/{margin}/g,E).replace(/{unit}/g,"").replace(/{angle}/g,null!=O?O:"?"),s=t[P?"motion_insight_straight":"motion_insight"].replace(/{angle}/g,null!=O?O:"?").replace(/{operatorNote}/g,U)}"FITS"!==u||L||P||!R||"difficult"!==R&&"expert"!==R||(s+=" ".concat(U));let H=[o,r,l,s,"DOESNT_FIT"===u?"See what was checked.":"See how it navigates."].filter(Boolean).join("\n\n"),W=[],G=function(e,t){if(!e)return null;let n=(0,v.x)(t),i=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},n,{context:"prose",precision:"measurement"}),a=e.label||e.type||"Equipment",o="class_template"===e.resolution?"class average":"default"===e.resolution?"default":"user-prov
1ided",r=["**".concat(a,"** (").concat(o,")")];return e.turning_radius_mm&&r.push("Turning radius: ".concat(i(e.turning_radius_mm))),e.width_mm&&r.push("Width: ".concat(i(e.width_mm))),r.join(" \xb7 ")}(T,c);if(G&&W.push(G),(null==b||null==(t=b.notes)?void 0:t.length)>0){let e=b.notes.map(e=>"▸ ".concat(e)).join("\n");W.push(e)}let q=[...e.assumptions||[],...d].filter(Boolean);q.length>0&&W.push(q.map(e=>"▸ ".concat(e)).join("\n"));let j=(I||"warehouse").charAt(0).toUpperCase()+(I||"warehouse").slice(1);if(W.push("Safety margin: ".concat(j)),W.push("On-site verification recommended — real-world clearances may differ due to obstacles, floor surfaces, and equipment variation."),(null==(n=e.warnings)?void 0:n.length)>0)for(let t of e.warnings)W.push("Note: ".concat(t));return"".concat(H,"\n\n[details-below]\n\n").concat(W.join("\n\n"))}(e,{userUnit:ee,assumptions:en,dimensionSource:ei});if("optimization"===et||(null==e?void 0:e.queryType)==="optimization"){let t=(0,y.wv)(e,{userUnit:ee});return(null==t?void 0:t.content)||null}if("comparison"===et||(null==e?void 0:e.queryType)==="comparison"){let t=(0,y._Q)(e,{userUnit:ee});return(null==t?void 0:t.content)||null}if("arrangement"===et||(null==e?void 0:e.queryType)==="arrangement"){let t=(0,y.Tj)(e,{userUnit:ee});return(null==t?void 0:t.content)||null}if("residual"===et||(null==e?void 0:e.queryType)==="residual"){let t=(0,y.generateResidualResponse)(e,{userUnit:ee});return(null==t?void 0:t.content)||null}if("hybrid"===et||(null==e?void 0:e.queryType)==="hybrid"){let t=(0,y.FT)(e,{userUnit:ee,assumptions:en,dimensionSource:ei});return(null==t?void 0:t.content)||null}if("load_capacity"===et||(null==e?void 0:e.queryType)==="load_capacity")return function(e){var t;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1],!e)return null;let n=["**".concat("elevator"===(t=e).loadKind&&t.weightKnown?"DOESNT_FIT"===t.verdict?"Exceeds the ~".concat((0,D.c)(t.ratedCapacityKg)," ").concat(t.cabClass," elevator limit"):"FITS_TIGHT"===t.verdict?"Near the ~".concat((0,D.c)(t.ratedCapacityKg)," ").concat(t.cabClass," elevator limit"):"Within the ~".concat((0,D.c)(t.ratedCapacityKg)," ").concat(t.cabClass," elevator limit"):"elevator"===t.loadKind?"Weight estimate vs the ~".concat((0,D.c)(t.ratedCapacityKg)," elevator limit"):"floor"===t.loadKind?"Floor-load guidance for ".concat(F(t.weight_kg,t.weightKnown)):"carry"===t.loadKind?"Carrying ".concat(F(t.weight_kg,t.weightKnown)):"Weight note for ".concat(F(t.weight_kg,t.weightKnown)),"**")];for(let t of(e.note&&n.push(e.note),e.weightKnown||n.push("_Weight is an estimate — confirm the item's actual weight for a firm answer._"),e.warnings||[]))n.push("⚠ ".concat(t));return n.join("\n\n")}(e,{userUnit:ee});if("move_size"===et||(null==e?void 0:e.queryType)==="move_size"){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{userUnit:n="in"}=t;return{prose:A(e,n),verdictDisplay:function(e,t){let{verdict:n,band:i,recommended:a,multiLoad:o}=e,r=O(i);if("FITS"===n||"TIGHT_FIT"===n)return{isFit:"FITS"===n||"TIGHT_FIT"===n,capacityHeadline:(null==a?void 0:a.label)||"Recommended",capacitySubline:"TIGHT_FIT"===n?"Tight fit for a ".concat(r," (~").concat(C(null==i?void 0:i.expected,t),")"):"Comfortable for a ".concat(r," (~").concat(C(null==i?void 0:i.expected,t),")")};if("DOESNT_FIT"===n){var l,s;return{isFit:!1,capacityHeadline:"Needs ~".concat(null!=(s=null==o?void 0:o.loads)?s:2," loads"),capacitySubline:"A ".concat(r," exceeds a single ").concat((null==o||null==(l=o.baseClass)?void 0:l.label)||"unit")}}return"UNKNOWN"===n?{isFit:!1,capacityHeadline:"≈".concat(C(null==i?void 0:i.expected,t)," (estimate)"),capacitySubline:"Add a bedroom count or item list to pin a size"}:{isFit:!1,capacityHeadline:"How big is the move?",capacitySubline:"Tell me the bedrooms or list the main items"}}(e,n),solverMetadata:{queryType:"move_size",verdict:e.verdict,confidence:e.confidence||"LOW",band:e.band||null,recommended:e.recommended||null,alternative:e.alternative||null,multiLoad:e.multiLoad||null,rankedOptions:R(e),explainText:function(e,t){let n=[A(e,t),""],{band:i}=e;return i&&i.expected>0&&n.push("This is an **estimate band**, not an exact number: a typical ".concat(O(i)," runs ")+"".concat(C(i.low,t),"–").concat(C(i.high,t)," ")+"(≈".concat(C(i.expected,t)," expected). A fuller-than-average home runs toward the high end.")),n.push(""),n.push("_Class sizes are typical for the size, not a specific rental company's exact spec._"),n.join("\n")}(e,n),resultsText:function(e,t){let n=R(e);return n.length?n.map(e=>"".concat(e.isRecommended?"➤ ":"  ").concat(e.label," — ").concat(C(e.usableCubicFt,t)," usable \xb7 ").concat(e.tradeoff)).join("\n"):A(e,t)}
1(e,n),calculationDetails:function(e,t){let n=[],{band:i,recommended:a,ranked:o,multiLoad:r}=e;if(i){var l,s;let e={bedrooms:"bedroom-count heuristic",checklist:"room checklist",item_list:"summed item volumes",none:"no anchoring signal"}[null==(l=i.basis)?void 0:l.tier]||"estimate";n.push({title:"1. Estimated volume",lines:["Basis: ".concat(e,"."),"Low ".concat(C(i.low,t)," \xb7 Expected ").concat(C(i.expected,t)," \xb7 High ").concat(C(i.high,t),"."),(null==(s=i.basis)?void 0:s.partialCoverage)?"Some listed items had no known size; the band is widened to avoid undercounting.":"The band narrows as the move is described more specifically (bedrooms → rooms → item list)."]})}let m=a||(null==r?void 0:r.baseClass)||(Array.isArray(o)?o[o.length-1]:null);if(m&&n.push({title:"2. Packing factor & usable space",lines:["".concat(m.label,": raw interior ").concat(C(m.rawCubicFt,t),"."),"Packing factor ".concat(Math.round(100*m.packingFactor),"% (real-world fill, not raw volume)."),"Usable space = ".concat(C(m.rawCubicFt,t)," \xd7 ").concat(m.packingFactor," = ").concat(C(m.usableCubicFt,t),".")]}),i&&Array.isArray(o)&&o.length>0){let e=o.map(e=>{let n=i.expected?Math.round((e.usableCubicFt-i.expected)/i.expected*100):null,a=null!=i.expected&&e.usableCubicFt>=i.expected,o=null!=n?" (".concat(n>=0?"+":"").concat(n,"% vs expected)"):"";return"".concat(a?"✓":"✕"," ").concat(e.label,": ").concat(C(e.usableCubicFt,t)," usable").concat(o)});n.push({title:"3. Class comparison",lines:e})}return n}(e,n),assumptions:Array.isArray(e.assumptions)?e.assumptions:[],proofSteps:Array.isArray(e.proofSteps)?e.proofSteps:[]}}}(e,{userUnit:ee});return(null==t?void 0:t.prose)||null}if("capacity"===et||(null==e?void 0:e.queryType)==="capacity"){f.U.log("[TEMPLATE] Routing to generateCapacityResponse. queryType:",et,"| solverResult.queryType:",null==e?void 0:e.queryType,"| recommendedCount:",null==e?void 0:e.recommendedCount);let t=(0,y.pw)(e,{userUnit:ee,assumptions:en,dimensionSource:ei});return f.U.log("[TEMPLATE] generateCapacityResponse returned:",t?t.substring(0,120):"NULL"),t}if("room_fit"===et||(null==e?void 0:e.queryType)==="room_fit")return function(e){var t,n,i,a,o,r,l,h;let u,_,g,T,I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:M="in",assumptions:S=[],dimensionSource:k="default"}=I;if(!e)return null;let{verdict:N,margin_mm:x,details:E,needs_user_input:D}=e,F=(0,v.x)(M),C=e=>(0,w.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},F,{context:"prose",precision:"measurement"}),O=(null==E?void 0:E.furnitureType)||(null==(t=e.parsedRoomItem)?void 0:t.furnitureType)||null;if("CLARIFY"===N||"UNKNOWN"===N){let e=(null==D?void 0:D.join("; "))||"Some dimensions are missing";return s.CLARIFY.standard.replace(/{reason}/g,e)}if((0,y.FB)(e),y.Fk&&e.tightestPoint){let t=(0,y.qd)(e,{userUnit:M,assumptions:S,dimensionSource:k});if(t)return t}let R=C((null==E?void 0:E.min_walkway_mm)||Math.abs(x||0)),A="";if(null==E?void 0:E.walkways){let e=E.walkways,t=[];e.left>0&&t.push("left: ".concat(C(e.left))),e.right>0&&t.push("right: ".concat(C(e.right))),e.foot>0&&t.push("foot: ".concat(C(e.foot))),t.length>0&&(A="Walkways — ".concat(t.join(", "),"."))}let L=(null==E?void 0:E.strategyDesc)||(null==E?void 0:E.strategy)||"centered against one wall",P=(null==(n=e.parsedRoomItem)?void 0:n.name)||"The item",U=O?({sofa:"couch",sectional:"couch",loveseat:"couch",desk:"office_desk",table:"dining_table"})[O]||O:null,H=U?m[U]:null;if("DOESNT_FIT"===N)_=(null==E?void 0:E.reason)==="ceiling"?s.DOESNT_FIT.ceiling:(null==E?void 0:E.reason)==="floor_area"?(null==H||null==(a=H.DOESNT_FIT)?void 0:a.floor)||s.DOESNT_FIT.floor:(null==H||null==(o=H.DOESNT_FIT)?void 0:o.walkway)||s.DOESNT_FIT.walkway,g=d.DOESNT_FIT;else if("FITS_VERY_TIGHT"===N)_=(null==H||null==(r=H.FITS_VERY_TIGHT)?void 0:r.standard)||s.FITS_VERY_TIGHT.standard,g=d.FITS_VERY_TIGHT;else if("FITS_TIGHT"===N)_=(null==H||null==(l=H.FITS_TIGHT)?void 0:l.standard)||s.FITS_TIGHT.standard,g=d.FITS_TIGHT;else if("FITS"===N){let e=x>=1219?"comfortable":"standard";_=(null==H||null==(h=H.FITS)?void 0:h[e])||s.FITS[e],g=d.FITS}else if("LIKELY_FITS"===N)_=s.FITS.standard,g=d.FITS;else{if("LIKELY_DOESNT_FIT"!==N)return f.U.warn('[ROOM-TEMPLATE] Unrecognized verdict "'.concat(N,'" — falling through to null')),null;_=s.DOESNT_FIT.walkway,g=d.DOESNT_FIT}let W=(u=(null==E?void 0:E.excess_mm)?E.excess_mm:Math.abs(x||0),(0,w.ix)({mm:null!=u?u:0,role:"clearance",source:"solver"},F,{context:"prose",precision:"measurement"})),G=(null==E?void 0:E.roomHeight_mm)?C(E.roomHeight_mm):"?",q=_.replace(/{minWalkway}/g,R).replace(/{unit}/g,"").replace(/{walkwayBreakdown}/g,A).replace(/{strategyDesc}/g,L).replace(/{itemLabel}/g,P).replace(/{excess}/g,W).replace(/{roomHeight}/g,G);
1if(null==E?void 0:E.comfortProfile){let e=E.comfortProfile,t="compact"===e.key?({FITS:"TIGHT BUT FUNCTIONAL",FITS_TIGHT:"VERY TIGHT",FITS_VERY_TIGHT:"DOESN'T FIT",DOESNT_FIT:"DOESN'T FIT"})[N]||N:null,n="compact"===e.key&&t?"Based on compact urban clearance standards. For standard residential clearances, the verdict would be ".concat(t,"."):"Based on comfort-first clearance standards. Standard residential clearances may produce a more favorable verdict.";q+="\n\n*".concat(n,"*")}if((null==E?void 0:E.assumptionDescription)&&(q+="\n\n*Assumes: ".concat(E.assumptionDescription,"*")),(null==E||null==(i=E.alternatives)?void 0:i.length)>0){let e=E.alternatives[0],t={FITS:"FITS",FITS_TIGHT:"TIGHT BUT FUNCTIONAL",FITS_VERY_TIGHT:"VERY TIGHT",DOESNT_FIT:"DOESN'T FIT"}[e.verdict]||e.verdict;q+=" If ".concat(e.assumption.toLowerCase(),", the verdict improves to **").concat(t,"**.")}if("DOESNT_FIT"!==N&&O){let e=c[O];e&&(q+="\n\n".concat(e))}g&&(q+="\n\n"+g),"MEDIUM"===e.confidence&&S.length>0&&(q+=" (".concat(S[0],")")),"room_scan"===k&&("FITS_TIGHT"===N||"FITS_VERY_TIGHT"===N)&&(q+=' Scan measurements have \xb11-2" tolerance — consider measuring the tightest dimension manually.');let j=(0,b.el)(e,{userUnit:M,queryType:"room",itemName:P,spaceName:null});if(j&&!j.includes("Proof unavailable"))T=[j];else{let t=(0,p.qc)("room",e,{userUnit:M,itemName:P}),n=(e.checked_orientations||[]).reduce((e,t,n,i)=>{if(null==t.worstRatio)return e;let a=i[e];return(null==a?void 0:a.worstRatio)==null||t.worstRatio>a.worstRatio?n:e},0);T=[t,(0,p.li)(e.checked_orientations,M,{queryType:"room",bestIndex:n}),j].filter(Boolean)}return q+="\n\n[details-below]\n\n",q+=T.length>0?T.join("\n\n"):"**Calculation Summary**\nVerdict: ".concat(e.verdict,"\nMargin: ").concat(e.margin_mm,"mm")}(e,{userUnit:ee,assumptions:en,dimensionSource:ei});if("reverse-fit"===et||(null==e?void 0:e.queryType)==="reverse-fit"){let t=(null==e?void 0:e.spaceType)||"vehicle",n=(null==e?void 0:e.reverseFitResult)||e,i=(0,x.s9)(n,t,(null==n?void 0:n.logisticsResult)||null,{userUnit:ee}),a=null==e?void 0:e.classification;if((null==a?void 0:a.model)==="approximate_soft"&&i){let e=(null==n||null==(q=n.itemBreakdown)||null==(G=q[0])?void 0:G.name)||"these items",t=(0,y.Iz)(e,a.model);t&&(i+="\n\n"+t)}return i}if(!e||"UNKNOWN"===e.verdict)return null;if(e.cross_constraint_conflict){let t,n=(0,v.x)(ee),i=e.cross_constraint_details||{};if((null==(j=i.inlineFailure)?void 0:j.reason)==="rotation_sweep_blocked"||(null==(z=i.perpendicularFailure)?void 0:z.reason)==="rotation_sweep_blocked"){let e,o;t=a.CROSS_CONSTRAINT_ROTATION_BLOCKED.standard;let r=(null==(V=i.inlineFailure)?void 0:V.reason)==="rotation_sweep_blocked"?i.inlineFailure:i.perpendicularFailure;t=t.replace(/{angle}/g,r.angle_deg||"?").replace(/{sweep}/g,(e=r.maxSweep_mm,(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},n,{context:"prose",precision:"measurement"}))).replace(/{hallwayWidth}/g,(o=r.hallwayWidth_mm||i.hallwayWidth_mm,(0,w.ix)({mm:null!=o?o:0,role:"space-dimensions",source:"solver"},n,{context:"prose",precision:"measurement"}))).replace(/{unit}/g,"")}else t=a.CROSS_CONSTRAINT_DOESNT_FIT.standard;return t+("\n\n"+p.nG.DOESNT_FIT)}if((0,y.FB)(e),null==(t=e.details)?void 0:t.has_turn){if(y.Fk&&e.tightestPoint){let t=(0,y.MK)(e,{userUnit:ee,assumptions:en});if(t)return t}return function(e){var t,n,i;let a,o,r,l,s,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:c="in",assumptions:d=[]}=m,{verdict:h,margin_mm:u,details:_}=e,g=(0,v.x)(c),y=e=>(0,w.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),T=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"});if(!_)return f.U.warn('[TURN-TEMPLATE] No details object for verdict "'.concat(h,'" — returning null')),null;let I=_.binding_constraint||e.limiting_constraint,M=_.best_orientation;if(!M&&"DOESNT_FIT"!==h)return f.U.warn('[TURN-TEMPLATE] No best_orientation for verdict "'.concat(h,'" — returning null')),null;let S=(a=Math.abs(u),(0,w.ix)({mm:null!=a?a:0,role:"clearance",source:"solver"},g,{context:"prose",precision:"measurement"})),k=y(_.corridor_width_before_mm),N=y(_.corridor_width_after_mm),x=M?T(M.across_hallway_mm):null,E=M?T(M.vertical_mm):null,D=M?T
1(M.along_hallway_mm):null,F=_.ceiling_height_mm?y(_.ceiling_height_mm):null,C=[...d,...e.assumptions||[]].some(e=>e.toLowerCase().includes("ceiling"));if(o="corridor_width"===I?_.corridor_width_after_mm<_.corridor_width_before_mm?"".concat(N," inside corner"):"".concat(k," corridor"):"corner_sweep"===I?"corner sweep":"ceiling_height"===I?"ceiling":"clearance","DOESNT_FIT"===h){let t,a,r;if("corner_sweep"===I){let e=null!=_.bmax_mm?T(_.bmax_mm):null,n=(null==(i=_.closest_orientation)?void 0:i.across_hallway_mm)?T(_.closest_orientation.across_hallway_mm):null;t=e?"Cannot navigate the 90\xb0 corner — the item exceeds the ".concat(e," sweep limit by ").concat(S,"."):"No orientation clears the 90\xb0 corner.",a=n&&e?"With ".concat(n," across the corridor, the sweep geometry limits the navigable length to ").concat(e,". All 6 orientations exceed this."):"The shortest along-corridor dimension across all 6 orientations still exceeds what the turn geometry allows."}else if("corridor_width"===I)if((e.checked_orientations||[]).some(e=>e.width_margin_mm>=0&&null!=e.corner_margin_mm&&e.corner_margin_mm<0))t="No orientation navigates both the corridor and the turn — the closest exceeds the ".concat(o," by ").concat(S,"."),a="Narrower orientations fit the corridor width but cannot clear the corner. The closest-to-fitting orientation is too wide.";else if(_.short_circuit&&_.min_item_dimension_mm&&_.corridor_width_mm){let e=T(_.min_item_dimension_mm),n=y(_.corridor_width_mm);t="The item's smallest dimension (".concat(e,") exceeds the corridor width (").concat(n,") by ").concat(S," — no orientation fits."),a="Even in the narrowest orientation, the item is wider than the corridor. Corner sweep analysis is unnecessary."}else t="Exceeds the ".concat(o," by ").concat(S," — no orientation fits through the corridor."),a="The smallest usable cross-section is still wider than the narrowest point along the path.";else"ceiling_height"===I?(t="Exceeds the ceiling by ".concat(S," in all orientations."),a="The shortest achievable upright dimension still exceeds the available headroom."):(t="Does not fit — exceeds clearance by ".concat(S," in all orientations."),a="No orientation provides enough clearance to navigate the hallway and turn.");let l=null==_?void 0:_.closest_orientation;if(l){let e=T(l.across_hallway_mm),t=T(l.vertical_mm),n=T(l.along_hallway_mm);a+=" Closest orientation: ".concat(e," across, ").concat(t," upright, ").concat(n," along.")}let s=p.nG.DOESNT_FIT,m="".concat("**DOESN'T FIT** ✕","\n\n").concat(t,"\n\n").concat(a,"\n\n").concat(s);"MEDIUM"===e.confidence&&(null==(n=e.assumptions)?void 0:n.length)>0&&(m+=" (".concat(e.assumptions[0],")"));let d=(0,b.el)(e,{userUnit:c,queryType:"turn",itemName:null,spaceName:null});return m+="\n\n[details-below]\n\n",m+=(r=d&&!d.includes("Proof unavailable")?[d]:[(0,p.qc)("turn",e,{userUnit:c}),(0,p.li)(e.checked_orientations,c,{queryType:"turn"}),d].filter(Boolean)).length>0?r.join("\n\n"):"**Calculation Summary**\nVerdict: ".concat(e.verdict,"\nMargin: ").concat(e.margin_mm,"mm")}r="FITS"===h?"It will navigate the hallway and 90\xb0 turn.":"FITS_TIGHT"===h?"It will fit through the hallway and 90\xb0 turn, but clearance is tight.":"It can navigate the turn, but clearance is minimal — verify in person.",!C&&F&&"ceiling_height"!==I&&(r+=" Clears the ".concat(F," ceiling.")),l="corridor_width"===I?"The tightest point is the ".concat(o," — ").concat(S," of width clearance. Orientation: ").concat(x," across, ").concat(E," upright, ").concat(D," along."):"corner_sweep"===I?"The tightest constraint is the corner sweep — ".concat(S," of clearance to navigate the turn. Orientation: ").concat(x," across, ").concat(E," upright, ").concat(D," along."):"ceiling_height"===I?"The tightest constraint is the ".concat(F," ceiling — ").concat(S," of headroom. Orientation: ").concat(x," across, ").concat(E," upright, ").concat(D," along."):"Tightest clearance: ".concat(S,". Orientation: ").concat(x," across, ").concat(E," upright, ").concat(D," along.");let O="FITS_TIGHT"===h||"FITS_VERY_TIGHT"===h?p.nG.FITS_TIGHT:p.nG.FITS,R="".concat("FITS"===h?"**FITS** ✓":"FITS_TIGHT"===h?"**TIGHT FIT** ✓":"FITS_VERY_TIGHT"===h?"**FITS — VERY TIGHT** ⚠️":"**".concat(h,"**"),"\n\n").concat(r,"\n\n").concat(l);("FITS_TIGHT"===h||"FITS_VERY_TIGHT"===h)&&(R+=" These clearances assume a perfect rectangular shape — account for handles, feet, and arm rests which add to the effective dimensions."),R+="\n\n".concat(O),"MEDIUM"===e.confidence&&(null==(t=e.assumptions)?void 0:t.length)>0&&(R+=" (".concat(e.assumptions[0],")"));let A=(0,b.el)(e,{userUnit:c,queryType:"turn",itemName:null,spaceName:null});return(s=A&&!A.includes("Proof unavailable")?[A]:[(0,p.qc)("turn",e,{userUnit:c}),(0,p.li)(e.checked_orientations,c,{queryType:"turn"}
1),A].filter(Boolean)).length>0&&(R+="\n\n[details-below]\n\n",R+=s.join("\n\n")),R}(e,{userUnit:ee,assumptions:en})}if(y.Fk&&e.tightestPoint){let t=(0,y.hs)(e,{userUnit:ee,queryType:et,assumptions:en,dimensionSource:ei});if(t)return t}let{verdict:ea,margin_mm:eo,details:er}=e,el=(0,v.x)(ee),es=e=>(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},el,{context:"prose",precision:"measurement"}),em=e=>(0,w.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"solver"},el,{context:"prose",precision:"measurement"}),ec=e=>(0,w.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},el,{context:"prose",precision:"measurement"}),ed=es(eo),eh=es(Math.abs(eo)),eu=(null==er?void 0:er.smallest_item_dimension_mm)?ec(er.smallest_item_dimension_mm):null,e_=(null==er?void 0:er.opening_width_mm)?em(er.opening_width_mm):null,eg=(null==er?void 0:er.opening_width_mm)?em(er.opening_width_mm-25):null,ep=null==er?void 0:er.rotationNeeded,ef=(null==er?void 0:er.itemBlockingDim_mm)?ec(er.itemBlockingDim_mm):null,ew=(null==er?void 0:er.straightExcess_mm)?ec(er.straightExcess_mm):null,ev=(null==er?void 0:er.fittingDim_mm)?ec(er.fittingDim_mm):null,eb=e.limiting_constraint,ey=null==(n=e.checked_orientations)?void 0:n.find(e=>e.feasible);"height"===eb&&(null==ey||null==(_=ey.dimensions_mm)?void 0:_.height)?(K=ec(ey.dimensions_mm.height),$="height"):(K=(null==ey||null==(k=ey.dimensions_mm)?void 0:k.width)?ec(ey.dimensions_mm.width):ev,$="width");let eT=null,eI=null;if("FITS_VERY_TIGHT"===ea)X=ep&&ef?a.FITS_VERY_TIGHT_ROTATED.standard:a.FITS_VERY_TIGHT.standard,Q=p.nG.FITS_VERY_TIGHT;else if("FITS"===ea)X=ep&&ef?eo>=100?a.FITS_ROTATED.comfortable:a.FITS_ROTATED.standard:eo>=100?a.FITS.comfortable:a.FITS.standard,Q=p.nG.FITS;else if("FITS_TIGHT"===ea)X=ep&&ef?eo<25?a.FITS_TIGHT_ROTATED.veryTight:a.FITS_TIGHT_ROTATED.standard:eo<25?a.FITS_TIGHT.veryTight:a.FITS_TIGHT.standard,Q=p.nG.FITS_TIGHT;else if("DOESNT_FIT"===ea)X=(null==er?void 0:er.nearMiss)&&eu&&e_?a.DOESNT_FIT.withNearMiss:eu&&e_?a.DOESNT_FIT.withBlocking:e_?a.DOESNT_FIT.standard:a.DOESNT_FIT.noOpeningDim,Q=p.nG.DOESNT_FIT;else if("FITS_TILTED"===ea)X=(null==(B=a.FITS_ROTATED)?void 0:B.standard)||a.FITS.standard,Q=p.nG.FITS;else if("LIKELY_FITS"===ea)X=a.FITS.standard,Q=p.nG.FITS;else if("LIKELY_DOESNT_FIT"===ea)X=e_?a.DOESNT_FIT.standard:a.DOESNT_FIT.noOpeningDim,Q=p.nG.DOESNT_FIT;else{if("FITS_WONT_CLOSE"!==ea)return f.U.warn('[PASSAGE-TEMPLATE] Unrecognized verdict "'.concat(ea,'" — falling through to null')),null;X=a.FITS.standard,Q=p.nG.FITS}if((0,P.Me)(et)){Q=p.nG.STAIRS;let t=function(e,t,n){let i,a=String(t.limiting_constraint||"").toLowerCase(),r=t.spaceDims_mm||{},l="stairway",s=null;if("stair_headroom"===a)l="headroom",r.headroom_mm&&(s=n(r.headroom_mm));else if("stair_width"===a||"width"===a){var m;l="stair width";let e=null!=(m=r.effective_width_mm)?m:r.stair_width_mm;e&&(s=n(e))}let c=!!t._stairAssumedGeometryDowngrade;if("DOESNT_FIT"===e)i=s?o.DOESNT_FIT.withDim:o.DOESNT_FIT.standard;else if("LIKELY_DOESNT_FIT"===e)i=c?s?o.LIKELY_DOESNT_FIT.assumedWithDim:o.LIKELY_DOESNT_FIT.assumed:s?o.LIKELY_DOESNT_FIT.withDim:o.LIKELY_DOESNT_FIT.standard;else if("FITS_VERY_TIGHT"===e)i=o.FITS_VERY_TIGHT.standard;else if("FITS_TIGHT"===e)i=o.FITS_TIGHT.standard;else if("LIKELY_FITS"===e)i=c?o.LIKELY_FITS.assumed:o.LIKELY_FITS.standard;else{if("FITS"!==e&&"FITS_STRAIGHT"!==e)return null;i=o.FITS.standard}return{template:i,constraintNoun:l,stairDim:s}}(ea,e,em);t&&(X=t.template,eT=t.constraintNoun,eI=t.stairDim)}let eM=e.limiting_constraint||$||"width",eS="".concat(eM," (tightest by ").concat(ed,")"),ek=X.replace(/{margin}/g,ed).replace(/{excess}/g,eh).replace(/{unit}/g,"").replace(/{blockingDim}/g,eu||"?").replace(/{openingDim}/g,e_||"?").replace(/{itemBlockingDim}/g,ef||"?").replace(/{straightExcess}/g,ew||"?").replace(/{fittingDim}/g,ev||"?").replace(/{limitingDim}/g,K||ev||"?").replace(/{limitingAxis}/g,$||"width").replace(/{bindingLabel}/g,eS).replace(/{rotationDesc}/g,ep||"").replace(/{stairDim}/g,eI||"").replace(/{constraintNoun}/g,eT||"stairway");if((0,P.Me)(et)){let t=(0,P.eT)({...e,queryType:et}),n=(0,P.mc)(t,ee);n&&(ek+="\n\nWidth used: ".concat(n.widthSummary,"."),n.itemDimensions&&(ek+=" Item dimensions used: ".concat(n.itemDimensions,".")))}if(e.tiltingIntent&&e.tiltingNotNeeded&&ep){let e=null==er?void 0:er.passing_dimension_mm,t=e?ec(e):null,n=t?"Diagonal tilting won't work here — but a straight pass does when ".concat(ep,". The ").concat(t," dimension passes through the opening depth."):"Diagonal tilting won't work here — but a straight pass does when ".concat(ep,"."),i=ek.split("\n"),a=i.findIndex((e,t)=>t>0&&""!==e.trim());a>0?(i.splice(a,0,n,""),ek=i.join("\n")):ek+="\n\n"+n}if(null==er?void 0:er.nearMiss){let e=er.nearMiss;ek=ek.replace(/{nearMissRotation}/g,e.rotation||"reoriented").replace(/{nearMissMargin}/g,es(e.raw_clearance_mm)).replace(/{tolerance}/g,es(e.tolerance_applied_mm)).replace(/{nearMissDims}/g,e.orientation||"?")}"DOESNT_FIT"===ea&&eg&&(ek+=" "+(p.lK[et]||p.lK.general).replace(/{maxFit}/g,eg).replace(/{unit}/g,""));let eN=null==er?void 0:er.lCorner;if(eN&&null!=eN.along_mm)if(eN.fits){let e=es(eN.corner_margin_mm);ek+=" If the hallway has an L-shaped turn (assuming equal corridor widths), the item can also navigate the corner — ".concat(e," clearance. Real-world clearance may differ due to handles, furniture shape, and wall fixtures.")}else{let e=ec(eN.along_mm),t=ec(eN.bmax_mm),n=(null==(Y=eN.best_orientation)?void 0:Y.across_hallway_mm)?ec(eN.best_orientation.across_hallway_mm):null,i=n?" With ".concat(n," across the corridor, the 90\xb0 sweep geometry limits the navigable length to ").concat(t,"."):" The 90\xb0 corner geometry limits the navigable length to ".concat(t,".");ek+=" However, if the hallway has an L-shaped turn (assuming equal corridor widths on both sides), the ".concat(e," length won't clear the corner.").concat(i," Actual clearance depends on both corridor widths — tell us the second corridor's width for a precise answer.")}if(ek+="\n\n"+Q,"MEDIUM"===e.confidence&&en.length>0){let e=en[0];"room_scan"===ei&&(e=e.replace(/\bstandard\b/gi,"scanned").replace(/\bassumed\b/gi,"detected").replace(/\bassuming\b/gi,"based on scanned")),ek+=" (".concat(e,")")}if("room_scan"===ei&&("FITS_TIGHT"===ea||"FITS_VERY_TIGHT"===ea)&&(ek+=' Scan measurements have \xb11-2" tolerance — consider measuring the tightest dimension manually.'),e.dual_interpretation&&e.interpretation){let t="container"===e.interpretation?"fitting inside":"fitting through",n="container"===e.interpretation?"fitting through an opening":"fitting inside a container";ek+="\n\nWe interpreted this as ".concat(t,". If you meant ").concat(n,", try rephrasing your query.")}let ex="hallway"===et?"hallway":(0,P.Me)(et)?"stairs":"passage",eE=(0,b.el)(e,{userUnit:ee,queryType:ex,itemName:null,spaceName:null});return ek+="\n\n[details-below]\n\n",ek+=(J=eE&&!eE.includes("Proof unavailable")?[eE]:[(0,p.qc)(ex,e,{userUnit:ee,dimensionSource:ei}),(0,p.li)(e.checked_orientations,ee,{queryType:ex}
1),eE].filter(Boolean)).length>0?J.join("\n\n"):"**Calculation Summary**\nVerdict: ".concat(e.verdict,"\nMargin: ").concat(e.margin_mm,"mm")}function G(e,t){return(0,w.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},(0,v.x)(t),{context:"prose",precision:"measurement"})}let q={FITS:"FITS",FITS_TIGHT:"TIGHT FIT",FITS_VERY_TIGHT:"VERY TIGHT FIT",DOESNT_FIT:"DOESN'T FIT",UNKNOWN:"UNKNOWN"},j={straightforward:"Straightforward — no special handling needed",moderate:"Moderate — careful alignment recommended",precision:"Precision handling required — experienced operator recommended",expert:"Expert-level difficulty — professional movers recommended"},z={straightforward:"Easy",moderate:"Moderate",precision:"Precision",expert:"Expert"};function V(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"in";return e?e.found?e.upgradedFromOriginal?function(e,t){var n,i,a;let o=q[e.originalVerdict]||e.originalVerdict,r=q[e.verdict]||e.verdict,l=G(null==(n=e.tightestPoint)?void 0:n.clearance_mm,t),s=null!=(a=null==(i=e.tightestPoint)?void 0:i.marginPercent)?a:0,m="**Verdict upgraded: ".concat(o," → ").concat(r,"**\n\n");return m+="Static analysis showed the item won't fit straight through. ",m+="However, ".concat(function(e){let t=Math.round(e.requiredAngle_deg||0);return t<1?"a straight approach with adjusted positioning":"a diagonal entry at ".concat(t,"\xb0")}(e)," creates **").concat(l,"** clearance"),s>0&&(m+=" (".concat(s,"%)")),m+=".",m+=K(e,t),m+=B(e,t),m+=Y(e)}(e,t):function(e,t){var n;let i=G(null==(n=e.tightestPoint)?void 0:n.clearance_mm,t),a=Math.round(e.requiredAngle_deg||0),o="**Maneuver confirmed**\n\n";return o+="Optimal path uses **".concat(a,"\xb0 entry** with **").concat(i,"** clearance."),o+=K(e,t),o+=B(e,t),o+=Y(e)}(e,t):function(e,t){let n=e.samplesChecked||0,i="**No feasible maneuver found**\n\n";return i+="Searched ".concat(n," configurations. "),i+="The item exceeds the space capacity regardless of orientation or approach angle.",i+="\n\n[why-detail
1s]\n> How to make it work\n\n- Shorten or disassemble the item if possible\n- Temporarily widen the opening (remove door, trim, or casing)\n- Two-person carry for better control on tight attempts\n- Consider an alternate entry point with more clearance\n[/why-details]"}(e,0):""}function B(e,t){let n=e.path||[];if(0===n.length)return"";let i="\n\n[maneuver-details]\n> Step-by-step maneuver (".concat(n.length," steps)");for(let e of n){let n=G(e.clearance_mm,t);i+="\n".concat(e.step,". **").concat(e.label,"** — ").concat(n," clearance")}if(e.tightestPoint){var a;let n=G(e.tightestPoint.clearance_mm,t),o=null!=(a=e.tightestPoint.marginPercent)?a:0;i+="\n\n**Tightest point:** Step ".concat(e.tightestPoint.step," — ").concat(n," clearance (").concat(o,"%)")}return i+"\n[/maneuver-details]"}function Y(e){var t;let n=j[e.difficulty]||"Unknown",i=z[e.difficulty]||"Unknown",a="\n\n[difficulty-details]\n> Effort required: ".concat(i);if(a+="\n\n".concat(n),e.difficultyReason&&(a+="\n\n".concat(e.difficultyReason)),(null==(t=e.warnings)?void 0:t.length)>0)for(let t of(a+="\n\n**Warnings:**",e.warnings))a+="\n- ".concat(t);return a+"\n[/difficulty-details]"}function K(e,t){var n;if(!(null==(n=e.tightestPoint)?void 0:n.belowSafetyThreshold))return"";let i=G(e.tightestPoint.clearance_mm,t);return"\n\n> **⚠️ Caution:** Clearance at tightest point (".concat(i,") is below the recommended safety margin. Proceed with extreme caution.")}},24861:(e,t,n)=>{n.d(t,{h:()=>o,i:()=>r});var i=n(52616);let a="/api/telemetry/perceived-latency";function o(e){let t=JSON.stringify(e);try{if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){let e=new Blob([t],{type:"application/json"});navigator.sendBeacon(a,e);return}}catch(e){}try{fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0}).catch(()=>{})}catch(e){}}let r=function(){let e=null;return"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{e&&"undefined"!=typeof document&&document.hidden&&(e.wasHidden=!0)}),{beginTurn(t){let n=(0,i.$)();return e={id:n,t0:"undefined"!=typeof performance?performance.now():0,bsid:t||"",wasHidden:"undefined"!=typeof document&&document.hidden||!1,done:!1},n},currentTurnId(){var t;return null!=(t=null==e?void 0:e.id)?t:null},turnStart:t=>e&&t&&e.id===t?{t0:e.t0,wasHidden:e.wasHidden}:null,completeTurn(t){if(!e||e.done||e.id!==t)return;let n=Math.round(("undefined"!=typeof performance?performance.now():0)-e.t0),i=e.bsid,a=e.wasHidden;if(e.done=!0,i){if(a)return o({client_turn_id:t,bsid:i,unmeasurable_reason:"hidden"});if(n<0||n>12e4)return o({client_turn_id:t,bsid:i,unmeasurable_reason:"clock_anomaly"});o({client_turn_id:t,perceived_latency_ms:n,bsid:i})}}}}()},26236:(e,t,n)=>{n.d(t,{U:()=>o});var i=n(58271),a=n(65927);function o(e,t){let n=t.length_mm,o=t.width_mm,r=t.height_mm;i.U.log("[BinPack3D] Space: ".concat(n,"mm deep \xd7 ").concat(o,"mm wide \xd7 ").concat(r,"mm tall (").concat((n/25.4).toFixed(1)," \xd7 ").concat((o/25.4).toFixed(1)," \xd7 ").concat((r/25.4).toFixed(1),'")')),i.U.log("[BinPack3D] Packing ".concat(e.length," items"));let l=Math.ceil(n/10),s=Math.ceil(o/10),m=Array.from({length:s},()=>new Float32Array(l)),c=[],d=0,h=e.map((e,t)=>({...e,originalIndex:t,volume:(e.width_mm||0)*(e.depth_mm||0)*(e.height_mm||0)}));for(let e of(h.sort((e,t)=>t.volume-e.volume),h)){let t=(0,a.Rw)({length:e.depth_mm,width:e.width_mm,height:e.height_mm}),h=null,u=1/0;for(let i of t){let t=i.l,a=i.w,c=i.h;if(t>n||a>o||c>r)continue;let d=Math.ceil(t/10),_=Math.ceil(a/10);for(let g=0;g<=s-_;g++)for(let s=0;s<=l-d;s++){if(10*s+t>n||10*g+a>o)continue;let l=0;for(let e=g;e<g+_;e++)for(let t=s;t<s+d;t++)m[e][t]>l&&(l=m[e][t]);if(l+c>r)continue;let p=0;for(let e=g;e<g+_;e++)for(let t=s;t<s+d;t++)p+=l-m[e][t];let f=1e3*l+p;f<u&&(u=f,h={originalIndex:e.originalIndex,orientation:i,position:{x:10*s,y:10*g,z:l},itemL:t,itemW:a,itemH:c,row:g,col:s,cellsL:d,cellsW:_,restingHeight:l+c})}}if(!h)return i.U.log("[BinPack3D] ✗ Item ".concat(e.originalIndex," (").concat(e.name||"unnamed",") — no valid placement found")),{packed:!1,placements:c,failedItemIndex:e.originalIndex,margin_mm:null,margin_unknown_reason:"MARGIN_AMBIGUOUS_CONSTRAINT"};for(let e=h.row;e<h.row+h.cellsW;e++)for(let t=h.col;t<h.col+h.cellsL;t++)m[e][t]=h.restingHeight;let _=h,g=_.position.x+_.itemL,p=_.position.y+_.itemW,f=_.restingHeight;i.U.log("[BinPack3D] ✓ Item ".concat(_.originalIndex," (").concat(e.name||"unnamed","): orient(").concat(_.itemL,"\xd7").concat(_.itemW,"\xd7").concat(_.itemH,"mm) pos(").concat(_.position.x,", ").concat(_.position.y,", ").concat(_.position.z,"mm) → ends(").concat(g,"mm deep, ").concat(p,"mm wide, ").concat(f,"mm tall)")),d+=e.volume,c.push({originalIndex:h.originalIndex,orientation:h.orientation,position:h.position})}let u=0,_=0,g=0;for(let e of c){var p,f,w;let t=e.position.x+((null==(p=e.orientation)?void 0:p.l)||0),n=e.position.y+((null==(f=e.orientation)?void 0:f.w)||0),i=e.position.z+((null==(w=e.orientation)?void 0:w.h)||0);t>_&&(_=t),n>g&&(g=n),i>u&&(u=i)}for(let e=0;e<s;e++)for(let t=0;t<l;t++)m[e][t]>u&&(u=m[e][t]);let v=n*o*r,b=Math.round(r-u),y={length_mm:Math.round(n-_),width_mm:Math.round(o-g),height_mm:Math.round(r-u)};return i.U.log("[BinPack3D] Bounding box: ".concat(_,"mm deep \xd7 ").concat(g,"mm wide \xd7 ").concat(u,"mm tall")),i.U.log("[BinPack3D] Clearance: depth ".concat(y.length_mm,"mm (").concat(n,"-").concat(_,"), width ").concat(y.width_mm,"mm (").concat(o,"-").concat(g,"), height ").concat(y.height_mm,"mm (").concat(r,"-").concat(u,")")),i.U.log("[BinPack3D] Result: packed=true, fill=".concat((d/v*100).toFixed(1),"%")),{packed:!0,placements:c,margin_mm:b,wastedVolume_mm3:v-d,maxUsedHeight:u,maxUsedLength:_,maxUsedWidth:g,spaceUsed:{length_mm:n,width_mm:o,height_mm:r},clearancePerAxis:y,fillRatio:d/v}}},26578:(e,t,n)=>{n.d(t,{HC:()=>u,J7:()=>o,JE:()=>s,NY:()=>l,S7:()=>g,YZ:()=>r,bl:()=>d,gJ:()=>_,kF:()=>m,pg:()=>h,uu:()=>c,xs:()=>a});var i=n(45715);function a(e,t){return{name:"parsed-item"===t?e.name:e.label,type:"parsed-item"===t?e.category||"Item":e.type||"Item",dimensions:e.dimensions,dimensionSource:e.dimensionSource,sourceUrl:e.sourceUrl,fromDatabase:e.fromDatabase,category:e.category,confidence:e.confidence,isDefaulted:e.isDefaulted,userModified:e.userModified}}function o(e,t,n){var i;if((null==n||null==(i=n.items)?void 0:i.length)>0){let t=new Map(n.items.map(e=>[(e.name||"").toLowerCase(),e]));e=e.map(e=>{let n=t.get((e.name||"").toLowerCase());if(n){var i,a,o,r,l;return{...e,fromDatabase:null!=(i=n.fromDatabase)?i:e.fromDatabase,category:null!=(a=n.category)?a:e.category,confidence:null!=(o=n.confidence)?o:e.confidence,dimensionSource:null!=(r=n.dimensionSource)?r:e.dimensionSource,sourceUrl:null!=(l=n.sourceUrl)?l:e.sourceUrl}}return e})}return(null==n?void 0:n.space)&&t.length>0&&(t=t.map((e,t)=>{if(0===t){var i,a;return{...e,dimensionSource:null!=(i=n.space.dimensionSource)?i:e.dimensionSource,sourceUrl:null!=(a=n.space.s
1ourceUrl)?a:e.sourceUrl}}return e})),{detectedItems:e,detectedSpaces:t}}function r(e,t){try{sessionStorage.setItem(e,t)}catch(n){if("QuotaExceededError"===n.name||22===n.code){let n=[];for(let e=0;e<sessionStorage.length;e++){let t=sessionStorage.key(e);/^(schematic_|lang_|vehicle_demo_triggered_)/.test(t)&&n.push(t)}n.forEach(e=>sessionStorage.removeItem(e)),console.warn("[InlineChat] Purged ".concat(n.length," stale sessionStorage keys after QuotaExceededError"));try{sessionStorage.setItem(e,t)}catch(e){console.error("[InlineChat] sessionStorage still full after purge:",e)}}}}let l=e=>{if(!e)return!1;let t=e.toLowerCase();return[/^(hi|hello|hey|sup|yo)\s*[!.]?$/i,/^test(ing)?\s*(the)?\s*(chat|bot|pinned|message|system)?\s*$/i,/^how\s+are\s+you\??$/i,/^what('s)?\s+up\??$/i,/^good\s+(morning|afternoon|evening|night)\s*[!.]?$/i,/^thanks?\s*[!.]?$/i,/^ok(ay)?\s*$/i,/^bye\s*$/i,/^help\s*$/i,/^cool\s*$/i,/^nice\s*$/i,/^great\s*$/i,/^awesome\s*$/i,/^what\s+(can|do)\s+you\s+do\??$/i,/^what\s+is\s+this\??$/i,/^what\s+are\s+you\??$/i,/^who\s+are\s+you\??$/i,/^how\s+does\s+(this|it)\s+work\??$/i,/^what\s+can\s+i\s+(ask|do|try)\s*(here)?\??$/i,/^how\s+do\s+i\s+use\s+(this|it)\??$/i].some(e=>e.test(t))},s="[[GENERIC_EXAMPLES]]",m=()=>"".concat(s,"Tell me what you're trying to fit and where — I'll calculate the answer."),c=e=>{if(!e||"string"!=typeof e)return!1;if(/[\u0400-\u04FF\u4E00-\u9FFF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\u0600-\u06FF\u0590-\u05FF\u0370-\u03FF\u0E00-\u0E7F\u0900-\u097F]/.test(e)||/[ğşıİßłąęśćźżńñ¿¡řůďťňěșțăâîœæ]/i.test(e))return!0;let t=e.match(/[\u00C0-\u00FF\u0100-\u024F]/g);if(t&&t.length>=2)return!0;let n=e.toLowerCase().replace(/[^a-z\s]/g,"").split(/\s+/).filter(e=>e.length>1);return!(!(n.length>=2)||n.some(e=>i.$W.has(e)))};function d(e){if(!e)return 1;let t=e.toLowerCase().replace(/"/g,"in").replace(/'/g,"ft");return t.startsWith("ft")||"feet"===t||"foot"===t?12:t.startsWith("cm")?1/2.54:"mm"===t?1/25.4:"m"===t?39.37:1}function h(e){let t=e.match(/(\d)\s*(cm|mm|ft|feet|foot|in|inch|inches|"|'|m)\s*$/i);if(t)return t[2];let n=e.match(/\d\s*(cm|mm|ft|feet|foot|in|inch|inches|"|'|m)\s*[×xX]/i);return n?n[1]:null}async function u(e){if(!e.ok){let t=null,n=null;try{t=(n=await e.json()).message||null}catch(e){}let i=Error(t||"API error: ".concat(e.status));throw i.status=e.status,i.serverMessage=t,i.responseBody=n,i}return e.json()}function _(e){var t;return(null==e?void 0:e.status)===403&&(null==e||null==(t=e.responseBody)?void 0:t.requiresAuth)}function g(e){var t;return(null==e?void 0:e.status)===402&&(null==e||null==(t=e.responseBody)?void 0:t.insufficientTokens)}},27846:(e,t,n)=>{n.d(t,{J:()=>o});var i=n(11175),a=n(18819);function o(e,t,n){let o=[];if(!e||!t||!n)return{passed:!0,flags:[],hasContradiction:!1,hasHardFail:!1,hasPhantomSpace:!1,weakSignals:[]};if(function(e,t){if(!t||"DOESNT_FIT"!==t.verdict)return!1;let n=t.tightestPoint;return!((!(n&&Object.prototype.hasOwnProperty.call(n,"entityB_mm"))||null!=n.entityB_mm&&!(n.entityB_mm<=0))&&[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm].some(e=>null!=e&&e>0))}(t,n))return{passed:!1,flags:[{type:"PHANTOM_SPACE",reason:"DOESNT_FIT was computed against a null/zero space dimension — the shortfall is against a non-existent constraint."}],hasContradiction:!1,hasHardFail:!1,hasPhantomSpace:!0,weakSignals:[]};let r=(0,a.tX)(n.geometry),l=[["width",e.width_mm,t.width_mm],["depth",e.depth_mm,t.depth_mm],["height",e.height_mm,t.height_mm]].filter(e=>{let[t]=e;return r[t]}),s=l.map(e=>{let[,t]=e;return t}).filter(e=>null!=e&&e>0).sort((e,t)=>t-e),m=["door","doorway","opening"].includes(t.type),c=l.filter(e=>{let[t]=e;return!m||"depth"!==t}).map(e=>{let[,,t]=e;return t}).filter(e=>null!=e&&e>0).sort((e,t)=>t-e);if(0===s.length||0===c.length)return{passed:!0,flags:[],hasContradiction:!1,hasHardFail:!1,hasPhantomSpace:!1,weakSignals:[]};let d=Math.min(s.length,c.length),h=s.length>c.length?s.slice(-d).sort((e,t)=>t-e):s;for(let e=0;e<d;e++)if(h[e]>c[e]){o.push({type:"HARD_FAIL",reason:"Item dimension ".concat(Math.round(h[e]),"mm exceeds space dimension ").concat(Math.round(c[e]),"mm (sorted rank ").concat(e+1,")")});break}("container"===t.type||"box"===t.type||"suitcase"===t.type)&&s.reduce((e,t)=>
1e*t,1)>c.reduce((e,t)=>e*t,1)&&o.push({type:"WEAK_SIGNAL",reason:"Item volume exceeds container volume (supporting evidence, not definitive)"}),"DOESNT_FIT"===n.verdict&&h.every((e,t)=>null!=c[t]&&e<c[t]-150)&&d>=2&&o.push({type:"CONTRADICTION",reason:"Solver says DOESNT_FIT but all dimensions have >150mm clearance"});let u=["FITS","FITS_TIGHT","FITS_VERY_TIGHT","FITS_TILTED","LIKELY_FITS"];return u.includes(n.verdict)&&h.some((e,t)=>null!=c[t]&&e>c[t])&&o.push({type:"HARD_FAIL",reason:"Solver says FITS but item exceeds space in at least one dimension (sorted comparison)"}),u.includes(n.verdict)&&"number"==typeof n.margin_mm&&n.margin_mm<-i.SJ&&o.push({type:"HARD_FAIL",reason:"Solver says ".concat(n.verdict," but final margin is ").concat(Math.round(n.margin_mm),"mm (negative)")}),{passed:0===o.filter(e=>"WEAK_SIGNAL"!==e.type).length,flags:o,hasContradiction:o.some(e=>"CONTRADICTION"===e.type),hasHardFail:o.some(e=>"HARD_FAIL"===e.type),hasPhantomSpace:!1,weakSignals:o.filter(e=>"WEAK_SIGNAL"===e.type)}}},29157:(e,t,n)=>{n.d(t,{OL:()=>l});var i=n(84511),a=n(31990);let o={explicit_both:/\b(?:both|together|at the same time|at once|simultaneously)\b/i,one_other:/\b(?:one|first|1st)[\s\S]*\b(?:other|second|2nd|another)\b/i,two_items:/\btwo\s+(?:items?|things?|power\s*strips?|boxes?|packages?|pieces?|objects?)\b/i,listing:/(?:one|first|1st)\s+(?:being|is|measuring)[\s\S]*(?:and|,)[\s\S]*(?:other|second|2nd|another)\s+(?:being|is|measuring)/i,item_conjunction:/\b(?:the\s+)?(?:first|one)\s+(?:power\s*strip|item|thing|box|package)[\s\S]*\band\b[\s\S]*(?:the\s+)?(?:second|other|another)\s+(?:power\s*strip|item|thing|box|package)/i,all_items:/\ball\s+(?:\d+\s+)?(?:items?|things?|pieces?|of them)\b/i,demonstrative_plural:/\b(?:these|those)\s+(?:\d+\s+)?(?:items?|things?|pieces?|power\s*strips?)\b/i},r={version_or_model:/\b(?:v\d|version\s*\d|\d+[A-Z]|room\s*\d|model\s*\d|type\s*\d)\b/i,time_reference:/\b\d+\s*(?:am|pm|o'clock|hours?|minutes?|seconds?)\b/i,address_or_dim:/\b\d+\s*(?:street|st|avenue|ave|road|rd|drive|dr|floor|fl)\b/i};function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(null==e?void 0:e.toLowerCase())||"",l={isVersionOrModel:r.version_or_model.test(n),isTimeReference:r.time_reference.test(n),isAddressOrDim:r.address_or_dim.test(n)},s=Object.values(l).some(e=>e),m={hasBoth:o.explicit_both.test(n),hasOneOther:o.one_other.test(n),hasTwoItems:o.two_items.test(n),hasListing:o.listing.test(n),hasItemConjunction:o.item_conjunction.test(n),hasAllItems:o.all_items.test(n),hasDemonstrativePlural:o.demonstrative_plural.test(n),itemCount:t},c=m.hasBoth||m.hasOneOther||m.hasTwoItems||m.hasListing||m.hasItemConjunction||m.hasAllItems||m.hasDemonstrativePlural,d=[m.hasBoth,m.hasOneOther,m.hasTwoItems,m.hasListing,m.hasItemConjunction,m.hasAllItems,m.hasDemonstrativePlural].filter(Boolean).length,h=(0,i.bz)(e||"").filter(e=>{let t=(e.name||"").trim().toLowerCase();return!(e.qty>=1e3||/^(in|inch|inches|ft|foot|feet|cm|mm|m|meter|metre)(\b|$)/i.test(t)||(0,a.RP)(t)||(0,a.Iq)(t))});if(h.length>0&&!s){let e=h.reduce((e,t)=>e+t.qty,0);return{isMultiItem:e>1,itemCount:e,itemNames:h.map(e=>e.name),items:h,requiresJointPacking:e>1,source:"quantity-parser",signals:{...m,itemCount:e},reason:"Quantity parser found ".concat(h.length," item type(s), ").concat(e," total"),debug:{bulkItems:h,hasLanguageSignal:c,languageSignalCount:d,hasExclusion:s,exclusions:l}}}let u=!1,_="";t>1?(u=!0,_="Parser detected ".concat(t," items"),c&&(_+=" (confirmed by language signals)")):1===t&&c&&!s?(u=!0,_="Language signals suggest multiple items (parser found 1)"):0===t&&c&&!s&&(d>=2||m.hasBoth||m.hasListing)&&(u=!0,_="Strong language signals suggest multiple items");let g=u&&t>1;return{isMultiItem:u,signals:m,requiresJointPacking:g,reason:_,debug:{hasLanguageSignal:c,languageSignalCount:d,hasExclusion:s,exclusions:l}}}},30400:(e,t,n)=>{n.d(t,{px:()=>a,RI:()=>o}),n(75015),n(95704),n(95704),n(95704);let i=new Set(["single_solution","multiple_solutions","standard_fit"]);function a(e){var t,n,a,o,r;if(!e||!e.facts)return null;let l=e.facts,s=null,m=l.winningOrientation&&Number.isFinite(l.winningOrientation.margin_mm)?Math.abs(l.winningOrientation.margin_mm):null;return!i.has(l.confidenceTier)&&l.bindingAxis&&Number.isFinite(l.nonBindingAxisSlack_mm)&&null!=m&&l.nonBindingAxisSlack_mm>=Math.max(2*m,25)&&(s={axis:l.bindingAxis,slack_mm:l.nonBindingAxisSlack_mm}),{tier:null!=(t=l.confidenceTier)?t:null,multiplicity:null==(r=l.fittingCount)?null:r<=0?"none":1===r?"one"
1:r<=3?"few":"several",fittingCount:null!=(n=l.fittingCount)?n:null,fittingCountIsLowerBound:!0===l.fittingCountIsLowerBound,winning:l.winningOrientation?{label:null!=(a=l.winningOrientation.label)?a:null,margin_mm:l.winningOrientation.margin_mm}:null,runnerUp:l.runnerUp?{label:null!=(o=l.runnerUp.label)?o:null,margin_mm:l.runnerUp.margin_mm}:null,soleObstacle:s,tiltBand:function(e){if(null==e||!Number.isFinite(e))return null;let t=Math.abs(e);return t<15?"slight":t<40?"moderate":"steep"}(l.requiredTiltAngle_deg),tiltAngle_deg:Number.isFinite(l.requiredTiltAngle_deg)?l.requiredTiltAngle_deg:null,nearMiss:"near_miss"===l.confidenceTier&&Number.isFinite(l.nearMissDelta_mm)?{delta_mm:l.nearMissDelta_mm}:null}}function o(e){var t;if(!e)return null;let n=[],i={none:"no orientation works",one:"fits only one way",few:"fits a couple of ways",several:"fits several ways"};return"one"===e.multiplicity&&e.fittingCountIsLowerBound?n.push("fits at least one way"):e.multiplicity&&i[e.multiplicity]&&n.push(i[e.multiplicity]),(null==(t=e.winning)?void 0:t.label)&&!/\d/.test(e.winning.label)&&n.push("best tried ".concat(e.winning.label)),e.soleObstacle&&n.push("the ".concat(e.soleObstacle.axis," of the space is the only tight spot — the space has room in its other directions")),e.tiltBand&&n.push("needs a ".concat(e.tiltBand," tilt")),e.nearMiss&&n.push("it just barely misses"),n.length?n.join("; "):null}},31587:(e,t,n)=>{n.d(t,{NL:()=>s,Nc:()=>d,O8:()=>m,Qv:()=>h,X:()=>a,mC:()=>c,rW:()=>u});var i=n(3732);let a=new Set(["clothing","pillow","blanket","towel","linen","bag","cushion"]),o=/\b(?:shirts?|pants|jeans|jackets?|coats?|sweaters?|hoodies?|socks?|underwear|t-?shirts?|blouses?|dress(?:es)?|skirts?|scarves?|scarfs?|gloves?|hats?|beanies?|pillows?|cushions?|blankets?|towels?|linens?|duvets?|comforters?|quilts?|sleeping\s*bags?|stuffed\s*animals?|plush(?:ies)?|cloth(?:es|ing)?|curtains?|drapes?|fabric|foam|bean\s*bags?)\b/i,r=/(?:clothing|fabric|textile|linen|bedding|plush|fleece|knit|woven)/i,l={mattress:{maxPct:.15,axis:"height",bendRadius_mm:300},futon:{maxPct:.12,axis:"height",bendRadius_mm:250},cushion:{maxPct:.3,axis:"all",bendRadius_mm:null},pillow:{maxPct:.35,axis:"all",bendRadius_mm:null},blanket:{maxPct:.25,axis:"all",bendRadius_mm:null},comforter:{maxPct:.25,axis:"all",bendRadius_mm:null},duvet:{maxPct:.25,axis:"all",bendRadius_mm:null},sleeping_bag:{maxPct:.3,axis:"all",bendRadius_mm:null},towel:{maxPct:.2,axis:"all",bendRadius_mm:null},linen:{maxPct:.2,axis:"all",bendRadius_mm:null},clothing:{maxPct:.3,axis:"all",bendRadius_mm:null},bag:{maxPct:.15,axis:"all",bendRadius_mm:null},cardboard:{maxPct:.05,axis:"all",bendRadius_mm:null},foam:{maxPct:.2,axis:"all",bendRadius_mm:null},bean_bag:{maxPct:.25,axis:"all",bendRadius_mm:null},rug:{maxPct:0,axis:"all",bendRadius_mm:150},yoga_mat:{maxPct:0,axis:"all",bendRadius_mm:75},sofa_bed:{maxPct:.08,axis:"smallest",bendRadius_mm:null},inflatable:{maxPct:.4,axis:"all",bendRadius_mm:null}};function s(e){if(!e)return"rigid";let t=e.toLowerCase().trim(),n=(0,i.bD)(t,"theoretical");return n&&a.has(n.category)||o.test(t)||r.test(t)?"approximate_soft":"rigid"}function m(e){return e&&0!==e.length&&e.some(e=>"approximate_soft"===s(e.name))?"approximate_soft":"rigid"}function c(e){return!!e&&(o.test(e)||r.test(e))}function d(e){var t,n;return e&&"object"==typeof e?{...e,model:null!=(t=e.model)?t:s(e.name),shape:null!=(n=e.shape)?n:"box"}:e}function h(e){let t=function(e){if(!e)return null;let t=e.toLowerCase().trim(),n=(0,i.bD)(t,"theoretical");if(n&&l[n.category])return n.category;for(let e of Object.keys(l))if(RegExp("\\b".concat(e.replace("_","\\s*"),"s?\\b"),"i").test(t))return e;return/\b(?:shirts?|pants|jeans|jackets?|coats?|sweaters?|hoodies?|socks?|underwear|t-?shirts?|blouses?|dress(?:es)?|skirts?|scarves?|gloves?|hats?|cloth(?:es|ing))\b/i.test(t)?"clothing":/\b(?:cardboard\s*box(?:es)?|carton)\b/i.test(t)?"cardboard":/\b(?:bean\s*bags?)\b/i.test(t)?"bean_bag":/\b(?:sleeping\s*bags?)\b/i.test(t)?"sleeping_bag":/\b(?:yoga\s*mats?)\b/i.test(t)?"yoga_mat":/\b(?:sofa\s*beds?)\b/i.test(t)?"sofa_bed":null}(e);if(!t)return null;let n=l[t];return n?{...n,category:t}:null}function u(e,t){let n=h(t);
1if(!n||0===n.maxPct)return{...e,compressed:!1,compressionPct:0};let i=1-n.maxPct,a={...e,compressed:!0,compressionPct:Math.round(100*n.maxPct)};switch(n.axis){case"height":a.height_mm=Math.round(e.height_mm*i);break;case"smallest":{let t=[{key:"width_mm",val:e.width_mm},{key:"depth_mm",val:e.depth_mm},{key:"height_mm",val:e.height_mm}].sort((e,t)=>e.val-t.val);a[t[0].key]=Math.round(t[0].val*i);break}default:a.width_mm=Math.round(e.width_mm*i),a.depth_mm=Math.round(e.depth_mm*i),a.height_mm=Math.round(e.height_mm*i)}return a}},31659:(e,t,n)=>{n.d(t,{xQ:()=>u,xT:()=>h});var i=n(59296),a=n(95704);let o=Object.freeze(["LOW","MEDIUM","HIGH"]),r=Object.freeze({PARSER_UNCERTAIN:"CONFIDENCE_PARSER_UNCERTAIN",ENTITY_UNCERTAIN:"CONFIDENCE_ENTITY_UNCERTAIN",DIMENSION_ESTIMATED:"CONFIDENCE_DIMENSION_ESTIMATED",REQUIRED_DIMENSION_MISSING:"CONFIDENCE_REQUIRED_DIMENSION_MISSING",PRECISION_UNKNOWN:"CONFIDENCE_PRECISION_UNKNOWN",REQUIRED_CONSTRAINT_MISSING:"CONFIDENCE_REQUIRED_CONSTRAINT_MISSING",SUPPORT_PARTIAL:"CONFIDENCE_SUPPORT_PARTIAL",SUPPORT_APPROXIMATE:"CONFIDENCE_SUPPORT_APPROXIMATE",SUPPORT_FALLBACK:"CONFIDENCE_SUPPORT_FALLBACK",SUPPORT_UNSUPPORTED:"CONFIDENCE_SUPPORT_UNSUPPORTED",BOUNDARY_NEAR:"CONFIDENCE_BOUNDARY_NEAR",BOUNDARY_AT_LIMIT:"CONFIDENCE_BOUNDARY_AT_LIMIT",GEOMETRY_UNKNOWN:"CONFIDENCE_GEOMETRY_UNKNOWN"}),l=Object.freeze({CONFIDENCE_PARSER_UNCERTAIN:"Confirm which item and space should be checked.",CONFIDENCE_ENTITY_UNCERTAIN:"Confirm the exact item or vehicle configuration.",CONFIDENCE_DIMENSION_ESTIMATED:"Measure the decisive item and space dimensions.",CONFIDENCE_REQUIRED_DIMENSION_MISSING:"Provide the missing decisive item or space dimension.",CONFIDENCE_PRECISION_UNKNOWN:"Measure again and include the measurement precision.",CONFIDENCE_REQUIRED_CONSTRAINT_MISSING:"Provide the missing required measurement or constraint.",CONFIDENCE_SUPPORT_PARTIAL:"Verify the unsupported part of the route before acting.",CONFIDENCE_SUPPORT_APPROXIMATE:"Treat this as an estimate and verify with physical measurements.",CONFIDENCE_SUPPORT_FALLBACK:"Retry after the intended solver is available.",CONFIDENCE_SUPPORT_UNSUPPORTED:"Provide a supported scene or request a clarification.",CONFIDENCE_BOUNDARY_NEAR:"Re-measure the limiting clearance before relying on the result.",CONFIDENCE_BOUNDARY_AT_LIMIT:"Confirm the limiting measurement; the result is on the boundary.",CONFIDENCE_GEOMETRY_UNKNOWN:"Provide the missing geometry needed to calculate a margin."});Object.freeze({MAYBE:"Insufficient evidence for either direction; not a delivered fit verdict.",CONDITIONAL:"A direction is valid only if every surfaced decisive condition is true.",LIKELY_FITS:"Approximate evidence favors fit but does not prove it.",LIKELY_DOESNT_FIT:"Approximate evidence favors non-fit but does not prove it.",UNKNOWN:"The requested result is not established by the available inputs/support.",CLARIFY:"A specific user answer or measurement can resolve a decisive unknown."});let s=Object.freeze({linear:Object.freeze({boundary_max:13,tight_max:152,boundary_confidence:"LOW",tight_confidence:"MEDIUM",comfortable_confidence:"HIGH",boundary_verdict_family:"conditional"}),ratio:Object.freeze({boundary_max:.05,tight_max:.15,boundary_confidence:"LOW",tight_confidence:"MEDIUM",comfortable_confidence:"HIGH",boundary_verdict_family:"likely"}),count:Object.freeze({boundary_max:0,tight_max:1,boundary_confidence:"LOW",tight_confidence:"MEDIUM",comfortable_confidence:"HIGH",boundary_verdict_family:"conditional"}),mass:Object.freeze({boundary_max:0,tight_max:10,boundary_confidence:"LOW",tight_confidence:"MEDIUM",comfortable_confidence:"HIGH",boundary_verdict_family:"conditional"}),unavailable:Object.freeze({boundary_confidence:"MEDIUM",boundary_verdict_family:"unknown"})}),m=Object.freeze({LOW:0,MEDIUM:1,HIGH:2}),c=Object.freeze(["constraint_completeness","solver_support","measurement_provenance","measurement_precision","parser_certainty","entity_certainty","geometry_margin"]);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",n="object"==typeof e?null==e?void 0:e.level:e;if("number"==typeof n)return n>=.85?"HIGH":n>=.6?"MEDIUM":"LOW";let i=String(null!=n?n:"").toUpperCase();return"PROVEN"===i||"HIGH_CONFIDENCE"===i?"HIGH":"MODERATE"===i?"MEDIUM":"UNCERTAIN"===i?"
1LOW":o.includes(i)?i:t}function h(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0!==a?a.env:{},n=String(null!=(e=null==t?void 0:t.COMPOSITIONAL_CONFIDENCE_V1)?e:"off").toLowerCase();return["shadow","limited_live","live"].includes(n)?n:"off"}();if(!e||"object"!=typeof e||"off"===l)return e;let h=function(){var e,t,n,a,l,h,u;let _=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=d(null!=(t=_.parserCertainty)?t:_.parser_confidence,"MEDIUM"),p=d(null!=(n=_.entityCertainty)?n:_.entity_confidence,"MEDIUM"),[f,w]=function(e){var t,n;let i=[e.dimensionSource,e.dimension_source,e.itemDimSource,e.spaceDimSource,null==(t=e.item)?void 0:t.dimensions_source,null==(n=e.space)?void 0:n.dimensions_source,...Array.isArray(e.dimensionSources)?e.dimensionSources:[]].filter(Boolean).map(e=>String(e).toLowerCase());return e.estimatedDimensions||i.some(e=>/estimate|default|package|inferred|catalog/.test(e))?["MEDIUM",r.DIMENSION_ESTIMATED]:["HIGH",null]}(_),v=null!=(a=_.precisionKnown)?a:_.precision_known,b=!0===v?"HIGH":"MEDIUM",y=!0===_.missingDimensions||!0===_.requiredDimensionMissing,T=!(!0===_.missingConstraints||!0===_.requiredConstraintMissing||y)&&(!0===_.constraint_complete||!1===_.missingConstraints),I=T?"HIGH":"LOW",M=null!=(u=null!=(h=null!=(l=null==(e=_.solver_support)?void 0:e.support_level)?l:_.supportLevel)?h:_.support_level)?u:i.CZ.FALLBACK,[S,k]=M===i.CZ.FULL?["HIGH",null]:M===i.CZ.PARTIAL?["MEDIUM",r.SUPPORT_PARTIAL]:M===i.CZ.APPROXIMATION?["MEDIUM",r.SUPPORT_APPROXIMATE]:M===i.CZ.FALLBACK?["LOW",r.SUPPORT_FALLBACK]:["LOW",r.SUPPORT_UNSUPPORTED],[N,x,E]=function(e){var t,n,i,a,o,l,m,c,d,h,u,_,g;let p=null!=(n=e.canonical_margin)?n:e.canonicalMargin,f=null!=(a=null!=(i=null==(t=e.solver_support)?void 0:t.solver_id)?i:e.solverId)?a:"",w=/capacity|count|move_size/.test(f)?"count_remaining":/load_capacity/.test(f)?"load_capacity_remaining":/inventory/.test(f)?"fill_ratio_remaining":/comparison|optimization|arrangement/.test(f)?"unavailable":"binding_axis_clearance",v=null!=(m=null!=(l=null!=(o=null==p?void 0:p.margin_basis)?o:e.margin_basis)?l:e.marginBasis)?m:w,b=null!=(h=null!=(d=null!=(c=null==p?void 0:p.margin_band)?c:e.margin_band)?d:e.marginBand)?h:"unknown",y=null!=(g=null!=(_=null!=(u=null==p?void 0:p.margin_value)?u:e.margin_value)?_:e.marginMm)?g:e.margin_mm;if("unavailable"===v||null==y||!Number.isFinite(Number(y)))return["MEDIUM",r.GEOMETRY_UNKNOWN,{basis:v,band:"unknown"}];if("unknown"===b){let e=s["fill_ratio_remaining"===v?"ratio":"count_remaining"===v?"count":"load_capacity_remaining"===v?"mass":"linear"];b=Number(y)<=e.boundary_max?"boundary":Number(y)<=e.tight_max?"tight":"comfortable"}return 0===Number(y)||"boundary"===b?["LOW",r.BOUNDARY_AT_LIMIT,{basis:v,band:"boundary"}]:["tight","tolerance_shortfall"].includes(b)?["MEDIUM",r.BOUNDARY_NEAR,{basis:v,band:b}]:["HIGH",null,{basis:v,band:b}]}(_),D={parser_certainty:[g,"LOW"===g?r.PARSER_UNCERTAIN:null],entity_certainty:[p,"LOW"===p?r.ENTITY_UNCERTAIN:null],measurement_provenance:[f,w],measurement_precision:[b,!0===v?null:r.PRECISION_UNKNOWN],solver_support:[S,k],constraint_completeness:[I,T?null:y?r.REQUIRED_DIMENSION_MISSING:r.REQUIRED_CONSTRAINT_MISSING],geometry_margin:[N,x]},F=Math.min(...Object.values(D).map(e=>{let[t]=e;return m[t]})),C=c.find(e=>m[D[e][0]]===F),O=[...new Set(Object.values(D).filter(e=>{let[t,n]=e;return m[t]===F&&n}).map(e=>{let[,t]=e;return t}))].sort();return Object.freeze({confidence_schema_version:"confidence/v1",confidence:o.find(e=>m[e]===F),confidence_reasons:Object.freeze(O),confidence_ceiling_source:C,confidence_inputs:Object.freeze({parser_certainty:g,entity_certainty:p,measurement_provenance:f,measurement_precision:b,solver_support:S,support_level:M,constraint_completeness:I,geometry_margin:N,margin_basis:E.basis,margin_band:E.band})})}({...e,...n,solver_support:null!=(t=n.solver_support)?t:e.solver_support}),u=d(e.confidence,"MEDIUM"),_=m[u]<=m[h.confidence]?u:h.confidence,g={...e,confidence_candidate:_,confidence_reasons:h.confidence_reasons,confidence_ceiling_source:h.confidence_ceiling_source,confidence_inputs:h.confidence_inputs,confidence_schema_version:h.confidence_schema_version,confidence_rollout_mode:l};return"live"===l||"limited_live"===l?{...g,confidence:_}:g}function u(e){var t;return null!=(t=l[e])?t:null}},31990:(e,t,n)=>{n.d(t,{Iq:()=>l,RP:()=>r,V0:()=>o,VN:()=>a,fM:()=>i,hO:()=>h,nA:()=>m,uv:()=>d,yf:()=>s});let i=new Set(["sofa","couch","sectional","loveseat","armchair","recliner","chair","ottoman","bed","mattress","headboard","boxspring","dresser","nightstand","wardrobe","armoire","desk","table","bookshelf","bookcase","cabinet","hutch","buffet","sideboard","fridge","refrigerator","washer","dryer","freezer","stove","range","oven","dishwasher","piano","treadmill","safe","kayak","canoe"]),a=new Map([["door","doorway"],["doorway","doorway"],["entryway","entryway"],["entrance","entryway"],["hallway","hallway"],["corridor","hallway"],["stairway","stairs"],["stairs","stairs"],["staircase","stairs"],["turn","turn"],["corner","turn"],["elevator","elevator"],["lift","elevator"],["room","room"],["gap","gap"],["opening","opening"],["trunk","vehicle"],["cab","vehicle"],["car","vehicle"],["van","vehicle"],["suv","vehicle"],["truck","vehicle"],["crate","container"],["container","container"],["suitcase","container"],["ceiling","ceiling"]]),o=new Set(["room","bedroom","bathroom","kitchen","garage","door","doorway","entryway","entrance","hallway","corridor","stair","stairs","stairway","staircase","turn","corner","elevator","lift","gap","opening","ceiling","
1wall","floor","space","basement"]);function r(e){let t=String(e||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(0===t.length)return!1;let n=t[t.length-1];return o.has(n)||o.has(m(n))}function l(e){let t=String(e||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(t.length<3)return!1;let n=t.length-1;for(let e=0;e<n-1;e++)if(o.has(t[e]))return!0;return!1}let s=new Set(["boat","yacht","pontoon","rowboat","kayak","canoe","dinghy","rv","motorhome","camper","trailer","shed","garage","workshop","cabin","treehouse","tent","yurt","gazebo","box","bin","crate","container","trunk","closet","drawer","cabinet","locker","dumpster","basket","cup","mug","glass","jar","bowl","pot","bucket","vase","bottle","room"]);function m(e){if(!e)return e;let t=e.toLowerCase();return t.endsWith("ss")?t:t.endsWith("es")&&t.length>4?t.slice(0,-2):t.endsWith("s")&&t.length>3?t.slice(0,-1):t}function c(e){var t;return e&&null!=(t=e.toLowerCase().match(/\b[a-z]+\b/g))?t:[]}function d(e){let t=c(e),n=new Set;for(let e of t){let t=m(e);i.has(t)&&n.add(t)}return[...n]}function h(e){let t=c(e),n=[],i=new Set;for(let e of t){let t=a.has(e)?e:m(e);a.has(t)&&!i.has(t)&&(n.push({noun:t,type:a.get(t)}),i.add(t))}return n}},33403:(e,t,n)=>{n.d(t,{wf:()=>w,YM:()=>y});let i=Math.PI/2,a=(e,t,n)=>{let[a,o]=(e=>[e===i?0:Math.cos(e),e===i?1:Math.sin(e)])(n);return e*a+t*o};function o(e,t,n,i){let o=Math.min(n,i),r=Math.max(n,i),l=Math.atan2(t,e);return Math.max(...[o,r,...l>o&&l<r?[l]:[]].map(n=>a(e,t,n)))}function r(e,t,n,i,a,o){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=!(arguments.length>7)||void 0===arguments[7]||arguments[7],s={width_mm:i-r,depth_mm:a-r,height_mm:o},m={depth_mm:e,width_mm:t,height_mm:n};if(!([...Object.values(m),...Object.values(s)].every(e=>Number.isFinite(e)&&e>0)&&Number.isFinite(r)&&r>=0))return{model:"elevator-static-rectangle/1",scope:"static_placement",fits:!1,status:"invalid",witness:null,margin_mm:null,effectiveDimensions:s,projectedDimensions:m,perAxisMargins:{width_mm:null,depth_mm:null,height_mm:null},limitingAxis:null,proofSteps:[]};let c=(e,t,n)=>{let i=Math.hypot(e,t);if(n>i||n<0)return[];let a=Math.atan2(t,e),o=Math.acos(n/i);return[a-o,a+o].filter(e=>e>=0&&e<=Math.PI/2)},d=l?[0,Math.PI/2,...c(e,t,s.depth_mm),...c(t,e,s.width_mm)].sort((e,t)=>e-t):[0],h=[...d,...d.slice(1).map((e,t)=>(e+d[t])/2)],u=i=>{let a=i===Math.PI/2?0:Math.cos(i),o=i===Math.PI/2?1:Math.sin(i),r={width_mm:e*o+t*a,depth_mm:e*a+t*o,height_mm:n},l=Object.fromEntries(Object.keys(s).map(e=>[e,s[e]-r[e]])),m=Object.keys(l).reduce((e,t)=>l[t]<l[e]?t:e),c=l[m];return{yaw_rad:i,projectedDimensions:r,perAxisMargins:l,limitingAxis:m.replace("_mm",""),margin_mm:c}},_=u(0),g=_.margin_mm>=0?_:h.map(u).sort((e,t)=>t.margin_mm-e.margin_mm)[0],p=g.margin_mm>=0,f=p?{yaw_rad:g.yaw_rad,yaw_deg:180*g.yaw_rad/Math.PI,pitch_deg:0,roll_deg:0,dimensions_mm:m,projectedDimensions:g.projectedDimensions,center_mm:{depth:s.depth_mm/2,width:s.width_mm/2,height:n/2}}:null,w=p?Object.keys(s).map(e=>({id:"axis_inequality",passed:!0,limiting:e==="".concat(g.limitingAxis,"_mm"),values:{item_dim_mm:g.projectedDimensions[e],space_dim_mm:s[e],axis:"cab_".concat(e.replace("_mm","")),margin_mm:g.perAxisMargins[e]},comparison:{actual_mm:g.projectedDimensions[e],limit_mm:s[e],margin_mm:g.perAxisMargins[e]},note:"Static cab projection at yaw ".concat(f.yaw_deg," degrees; no entry or rotation proof.")})):[];return{model:"elevator-static-rectangle/1",scope:"static_placement",status:p?"witnessed":"no_witness",fits:p,method:0===g.yaw_rad?"axis_aligned":"floor_yaw",witness:f,projectedDimensions:g.projectedDimensions,perAxisMargins:g.perAxisMargins,margin_mm:g.margin_mm,limitingAxis:g.limitingAxis,effectiveDimensions:s,obstructionDeduction_mm:r,permittedYaw_rad:l?[0,Math.PI/2]:[0,0],continuous_path_proven:!1,proofSteps:w}}var l=n(41154),s=n(11189),m=n(77632),c=n(27836),d=n(65927),h=n(89175),u=n(89609),_=n(27236),g=n(85850);let p=Object.freeze({DOOR_BLOCKS:0,DOOR_CLEARANCE_ONLY:1,DOOR_CLEARS:2,FITS:3});function f(e,t){if(e.tier!==t.tier)return t.tier-e.tier;if(e.tightestMargin_mm!==t.tightestMargin_mm)return t.tightestMargin_mm-e.tightestMargin_mm;let n=e=>{var t;return+((null==e||null==(t=e.doorResult)?void 0:t.method)==="tilted")};return n(e)-n(t)}let w={passenger:{cab:{width_mm:1727,depth_mm:1372,height_mm:2286},door:{width_mm:914,height_mm:2032},rated_capacity_kg:1134},freight:{cab:{width_mm:2134,depth_mm:1829,height_mm:2438},door:{width_mm:1219,height_mm:2032},rated_capacity_kg:2268}};function v(e,t,n,i){if(e<=n||Math.min(e,t)>n||t>n)return null;let a=null,o=-1/0,r=-1/0;for(let l=1;l<=89;l++){let s=l*Math.PI/180,m=n-(e*Math.cos(s)+t*Math.sin(s)),c=i-(e*Math.sin(s)+t*Math.cos(s));if(m>=0&&c>=0){let e=Math.min(m,c);(null===a||e>Math.min(o,r))&&(a=l,o=m,r=c)}}return null===a?null:{fits:!0,margin_mm:Math.min(o,r),tiltAngle_deg:a,method:"tilted"}}let b=Object.freeze({"door.width_mm":"door opening width","door.height_mm":"door opening height","cab.width_mm":"inside width","cab.depth_mm":"inside depth","cab.height_mm":"inside height"});function y(e,t){var n,w,y,T,I,M;let S=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=(0,m.G5)(t),S=(0,l.w0)(t,S);let k=function(e,t){var n,l,m,c,w,y,T,I,M,S,k,N,x,E,D,F,C,O,R,A;let L=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},P=null!=(w=L.obstructionDeduction_mm)?w:0,U=null!=(y=L.multiPiece)&&y,H=null!=(T=L.pieceDimsKnown)&&T,W=[],G=[],q=[],j=e&&e.length&&e.width&&e.height?function(e){if(!function(e){if(!e||"object"!=typeof e)return!1;let t=[e.width,e.depth,e.height];if(!t.every(e=>"number"==typeof e&&e>0))return!1;let n=[...t].sort((e,t)=>
1e-t);return n[0]/n[2]<=.15}(e))return{isSlab:!1};let[t,n,i]=[e.width,e.depth,e.height].sort((e,t)=>e-t);return{isSlab:!0,thickness_in:t,face:{long:i,short:n},allowedOrientations:["flat","edge_long","edge_short"]}}({width:e.width/25.4,depth:e.length/25.4,height:e.height/25.4}):{isSlab:!1};if(!e||Object.keys(null!=(I=e.elevatorItemIssues)?I:{}).length>0||!["length","width","height"].every(t=>Number.isFinite(e[t])&&e[t]>0))return{verdict:"UNKNOWN",unknown_reason:_.r.MISSING_ITEM_DIMS,tone:"definitive",bestOrientation:null,restingOrientation:null,doorClearance:null,cabClearance:null,rotationClearance:null,tightestConstraint:"missing_dimensions",tightestMargin_mm:-999,checked_orientations:[],confidence:"LOW",assumptions:["Item dimensions not fully provided"],warnings:[],needs_user_input:["Complete item dimensions (length \xd7 width \xd7 height)"]};let{cab:z,door:V,inputValidation:B}=t;if(!B.complete){let e=Object.entries(B.fields).filter(e=>{let[,t]=e;return"resolved"!==t.status});return{verdict:"UNKNOWN",unknown_reason:_.r.MISSING_SPACE_DIMS,tone:"definitive",bestOrientation:null,restingOrientation:null,doorClearance:null,cabClearance:null,rotationClearance:null,tightestConstraint:"insufficient_data",tightestMargin_mm:null,checked_orientations:[],confidence:"LOW",assumptions:[],warnings:e.map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n.status)}),needs_user_input:e.map(e=>{let[t]=e;return"Confirm measured elevator ".concat(t)}),message:function(e){let t=t=>e.filter(e=>{let[,n]=e;return n.status===t}).map(e=>{var t;let[n]=e;return null!=(t=b[n])?t:n}),n=e=>e.length<2?e.join(""):"".concat(e.slice(0,-1).join(", ")," and ").concat(e[e.length-1]),i=[],a=t("missing"),o=t("conflicting"),r=[...t("invalid"),...t("assumed")];return a.length&&i.push("To check the elevator I need its ".concat(n(a),".")),o.length&&i.push("I have two different values for the elevator's ".concat(n(o),". Which one is right?")),r.length&&i.push("Please confirm the measured ".concat(n(r)," of the elevator.")),i.join(" ")||"To check the elevator I need its door opening and inside measurements."}(e)}}U&&!H&&(W.push("Each piece assumed to be full item size (worst case)"),q.push("Individual piece dimensions for more accurate assessment"),G.push("Worst-case sizing: actual pieces may be significantly smaller")),P>0&&W.push("Applied ".concat(Math.round(P/25.4),'" deduction for interior obstructions (handrails, panels)'));let Y=null!=(M=L.orientationConstraint)?M:!1===L.allowTilt||null!=L.maxPitch_deg?"upright":null,K=(0,d.Rw)(e);K=(0,u.sH)(K,Y,e,{strict:!0}),Y&&W.push("Only checking orientations where the item is ".concat({upright:"upright",flat:"flat",on_side:"on its side"}[Y]||Y," (as requested)."));let $=[];if(!1===L.allowYaw&&(K=K.slice(0,1)),!K.length)return(0,s.Sp)({needs_user_input:["A supported carry orientation"]});let X=[],Q=z.depth_mm-P;for(let e of K){let t=[{across_door:e.w,vertical:e.h,along_depth:e.l,face_index:0,face_label:"w\xd7h entry"},{across_door:e.l,vertical:e.h,along_depth:e.w,face_index:1,face_label:"l\xd7h entry"},{across_door:e.l,vertical:e.w,along_depth:e.h,face_index:2,face_label:"l\xd7w entry"}].filter((e,t)=>(!(0,s.Wy)(L)||t<2)&&(!1!==L.allowYaw||0===t)),n=null;for(let l of t){let t=function(e,t,n,i){let a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=function(e,t,n,i){let a=n-e,o=i-t,r=Math.min(a,o);return{fits:a>=0&&o>=0,margin_mm:r,widthMargin_mm:a,heightMargin_mm:o,limitingDimension:a<=o?"width":"height"}}(e,t,n,i);if(o.fits)return{passes:!0,method:"straight",margin_mm:o.margin_mm,tiltAngle_deg:null,limitingDimension:o.limitingDimension,doorDiagonal_mm:Math.round(Math.sqrt(n**2+i**2))};if(!a)return{passes:!1,method:"none",margin_mm:o.margin_mm,tiltAngle_deg:null,limitingDimension:o.limitingDimension};let r=v(e,t,n,i);if(r)return{passes:!0,method:"tilted",margin_mm:r.margin_mm,tiltAngle_deg:r.tiltAngle_deg,limitingDimension:"width",doorDiagonal_mm:Math.round(Math.sqrt(n**2+i**2))};if(e<=n&&t>i){let a=v(t,e,n,i);if(a)return{passes:!0,method:"tilted",margin_mm:a.margin_mm,tiltAngle_deg:90-a.tiltAngle_deg,limitingDimension:"height",doorDiagonal_mm:Math.round(Math.sqrt(n**2+i**2))}}let l=function(e,t,n,i){let a=Math.sqrt(e**2+t**2),o=Math.sqrt(n**2+i**2),r=Math.min(e,t),l=Math.min(n,i);if(r>l)return{fits:!1,margin_mm:Math.round(l-r),method:"diagonal"};let s=o-a;return{fits:s>=0,margin_mm:Math.round(s),itemDiagonal_mm:Math.round(a),doorDiagonal_mm:Math.round(o),method:"diagonal"}}(e,t,n,i);return{passes:!1,method:"none",margin_mm:Math.max(o.margin_mm,l.margin_mm),tiltAngle_deg:null,limitingDimension:o.limitingDimension,doorDiagonal_mm:Math.round(Math.sqrt(n**2+i**2))}}(l.across_door,l.vertical,V.width_mm,V.height_mm,!(0,s.Wy)(L)),m=Q-l.along_depth,c=l.along_depth<=Q,d=r(e.l,e.w,e.h,z.width_mm,z.depth_mm,z.height_mm,P,!1!==L.allowYaw),h=function(e,t,n,r){var l;let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},m={model:"elevator-contained-motion/1",scope:"aligned_opening_and_empty_cab",status:"no_witness",feasible:!1,needed:!0,method:"unsupported",margin_mm:null,witness:null,proofSteps:[],limitations:["Assumes a centered unobstructed opening, level sill and empty effective rectangular cab.","Outside approach, door hardware, handling mechanics and exit route are not evaluated.","Failure of full insertion before turning does not rule out combined insertion and turning."]};if(!(null==n?void 0:n.fits)||!t.passes||![0,1].includes(e.face_index))return m;let c=n.witness.dimensions_mm,d=n.effectiveDimensions,h=0===e.face_index?[c.depth_mm,c.width_mm,c.height_mm]:[c.width_mm,c.depth_mm,c.height_mm];if(![e.along_depth,e.across_door,e.vertical].every((e,t)=>e===h[t]))return m;let u=1===e.face_index?i:0,_=n.witness.yaw_rad,g=(null!=(l=t.tiltAngle_deg)?l:0)*Math.PI/180;if(![u,_,g].every(e=>Number.isFinite(e)&&e>=0&&e<=i)||!1===s.allowYaw&&(0!==u||0!==_)||(s.orientationConstraint||!1===s.allowTilt||null!=s.maxPitch_deg)&&0!==g||0!==u&&0!==g)return m;let p={depth_mm:e.along_depth,width_mm:a(e.across_door,e.vertical,g),height_mm:a(e.vertical,e.across_door,g)},f={depth_mm:e.along_depth,width_mm:o(e.across_door,e.vertical,0,g),height_mm:o(e.vertical,e.across_door,0,g)},w={depth_mm:o(c.depth_mm,c.width_mm,u,_),width_mm:o(c.width_mm,c.depth_mm,u,_),height_mm:c.height_mm},v=Object.fromEntries(Object.keys(d).map(e=>[e,Math.max(f[e],w[e])])),b=Object.fromEntries(Object.keys(d).map(e=>[e,d[e]-v[e]])),y=Object.keys(b).reduce((e,t)=>
1b[e]<=b[t]?e:t),T={width_mm:r.width_mm-p.width_mm-10,height_mm:r.height_mm-p.height_mm-10};if(m.margin_mm=b[y],m.bindingAxis=y,m.sweptDimensions=v,m.perAxisMargins=b,m.needed=0!==g||u!==_,m.method=m.needed?"contained_rotation":"slide_in",[...Object.values(b),...Object.values(T)].some(e=>!Number.isFinite(e)||e<0))return m;let I=(e,t,n,i)=>({yaw_rad:e,roll_rad:t,pitch_rad:0,center_mm:{depth:n,width:d.width_mm/2,height:i}}),M=I(u,g,-p.depth_mm/2,p.height_mm/2),S=I(u,g,d.depth_mm/2,p.height_mm/2),k=I(u,g,d.depth_mm/2,v.height_mm/2),N=I(u,0,d.depth_mm/2,v.height_mm/2),x=I(_,0,d.depth_mm/2,v.height_mm/2),E=I(_,0,d.depth_mm/2,c.height_mm/2),D=[{kind:"straight_insertion",from:M,to:S},{kind:"vertical_translation",from:S,to:k},{kind:"door_plane_unroll",from:k,to:N,angular_interval_rad:[g,0]},{kind:"cab_yaw",from:N,to:x,angular_interval_rad:[u,_]},{kind:"vertical_translation",from:x,to:E}];return m.feasible=!0,m.status="witnessed",m.witness={dimensions_mm:c,effectiveDimensions:d,basis:"R_depth(roll) * R_height(yaw); local axes depth,width,height",door:{...r,center_width_mm:d.width_mm/2,sill_height_mm:0,handling_clearance_mm:10},entryPose:M,finalPose:E,entryProjectedDimensions:p,doorMargins:T,stages:D,sweptDimensions:v},m.proofSteps=Object.keys(d).map(e=>({id:"axis_inequality",passed:!0,limiting:e===y,values:{axis:"motion_".concat(e.replace("_mm","")),item_dim_mm:v[e],space_dim_mm:d[e],margin_mm:b[e]},comparison:{actual_mm:v[e],limit_mm:d[e],margin_mm:b[e]},note:"Maximum projected extent over the entire declared contained rotation interval, including interior extrema."})),m}(l,t,d,V,L),u=t.margin_mm-10,_=t.passes&&u>=0,g=_&&c&&d.fits&&h.feasible,w=[{constraint:"door",margin:u},{constraint:"entry_depth",margin:m},{constraint:"cab",margin:d.margin_mm}];h.needed&&Number.isFinite(h.margin_mm)&&w.push({constraint:"rotation",margin:h.margin_mm});let b=w.reduce((e,t)=>e.margin<t.margin?e:t),y=g?p.FITS:_?p.DOOR_CLEARS:t.passes?p.DOOR_CLEARANCE_ONLY:p.DOOR_BLOCKS,T=b.margin-(p.FITS-y)*5e3;X.push({orientation:"".concat(e.l,"\xd7").concat(e.w,"\xd7").concat(e.h,"mm"),entry_face:l.face_label,entry_dimensions_mm:{across_door:l.across_door,vertical:l.vertical,along_depth:l.along_depth},feasible:g,tightestConstraint:b.constraint,tightestMargin_mm:b.margin,door_mm:u,door_geometric_mm:t.margin_mm,door_method:t.method,door_passes:_,entry_depth_mm:m,entry_depth_passes:c,cab_mm:d.margin_mm,cab_passes:d.fits,cab_per_axis:d.perAxisMargins||null,rotation_needed:h.needed,rotation_mm:h.needed?h.margin_mm===1/0?null:h.margin_mm:null,rotation_passes:h.feasible,movement:h,rejection_reason:g?null:b.constraint});let I={entry:l,doorResult:t,adjustedDoorMargin:u,cabResult:d,rotResult:h,entryDepthMargin_mm:m,allPass:g,tightestConstraint:b.constraint,tightestMargin_mm:b.margin,tier:y,sortMargin:T};(!n||0>f(I,n))&&(n=I)}$.push({orientation:e,...n})}$.sort(f);let J=$[0],Z=null!=(S=$.map(e=>e.cabResult).filter(e=>e.fits).sort((e,t)=>t.margin_mm-e.margin_mm)[0])?S:J.cabResult,ee=(()=>{var e,t,n,i,a,o,r,l,s,m,c;let d=[],h=V.width_mm-10*!!J.allPass,u=V.height_mm-10*!!J.allPass,_=J.entry.across_door,p=J.entry.vertical,f=J.doorResult.method,w=J.doorResult.tiltAngle_deg||null;if("tilted"===f&&null!=w){let e=w*Math.PI/180,t=_*Math.cos(e)+p*Math.sin(e),n=_*Math.sin(e)+p*Math.cos(e);if(d.push({id:"proj_w",passed:t<=h,values:{w_mm:_,h_mm:p,theta_deg:w,proj_w_mm:t},comparison:{actual_mm:t,limit_mm:h,margin_mm:h-t},note:"Door uses tilted insertion at ~".concat(w,"\xb0.")}),d.push({id:"proj_h",passed:n<=u,values:{w_mm:_,h_mm:p,theta_deg:w,proj_h_mm:n},comparison:{actual_mm:n,limit_mm:u,margin_mm:u-n}}),"door"===J.tightestConstraint){let e=d.find(e=>"proj_w"===e.id),t=d.find(e=>"proj_h"===e.id);(e.comparison.margin_mm<=t.comparison.margin_mm?e:t).limiting=!0}}else d.push({id:"axis_inequality",passed:_<=h,values:{item_dim_mm:_,space_dim_mm:h,axis:"door_width",margin_mm:h-_},comparison:{actual_mm:_,limit_mm:h,margin_mm:h-_},limiting:"door"===J.tightestConstraint&&"height"!==J.doorResult.limitingDimension}),d.push({id:"axis_inequality",passed:p<=u,values:{item_dim_mm:p,space_dim_mm:u,axis:"door_height",margin_mm:u-p},comparison:{actual_mm:p,limit_mm:u,margin_mm:u-p},limiting:"door"===J.tightestConstraint&&"height"===J.doorResult.limitingDimension});let v=J.cabResult.effectiveDimensions||{width_mm:z.width_mm-P,depth_mm:z.depth_mm-P,height_mm:z.height_mm},b=J.cabResult.perAxisMargins||{};if(d.push({id:"axis_inequality",passed:(null!=(e=b.width_mm)?e:0)>=0,values:{item_dim_mm:J.cabResult.projectedDimensions.width_mm,space_dim_mm:v.width_mm,axis:"cab_width",margin_mm:null!=(t=b.width_mm)?t:v.width_mm-J.cabResult.projectedDimensions.width_mm},comparison:{actual_mm:J.cabResult.projectedDimensions.width_mm,limit_mm:v.width_mm,margin_mm:null!=(n=b.width_mm)?n:v.width_mm-J.cabResult.projectedDimensions.width_mm},limiting:"cab"===J.tightestConstraint&&"width"===J.cabResult.limitingAxis}),d.push({id:"axis_inequality",passed:(null!=(i=b.depth_mm)?i:0)>=0,values:{item_dim_mm:J.cabResult.projectedDimensions.depth_mm,space_dim_mm:v.depth_mm,axis:"cab_depth",margin_mm:null!=(a=b.depth_mm)?a:v.depth_mm-J.cabResult.projectedDimensions.depth_mm},comparison:{actual_mm:J.cabResult.projectedDimensions.depth_mm,limit_mm:v.depth_mm,margin_mm:null!=(o=b.depth_mm)?o:v.depth_mm-J.cabResult.projectedDimensions.depth_mm},limiting:"cab"===J.tightestConstraint&&"depth"===J.cabResult.limitingAxis}),d.push({id:"axis_inequality",passed:(null!=(r=b.height_mm)?r:0)>=0,values:{item_dim_mm:J.cabResult.projectedDimensions.height_mm,space_dim_mm:v.height_mm,axis:"cab_height",margin_mm:null!=(l=b.height_mm)?l:v.height_mm-J.cabResult.projectedDimensions.height_mm},comparison:{actual_mm:J.cabResult.projectedDimensions.height_mm,limit_mm:v.height_mm,margin_mm:null!=(s=b.height_mm)?s:v.height_mm-J.cabResult.projectedDimensions.height_mm},limiting:"cab"===J.tightestConstraint&&"height"===J.cabResult.limitingAxis}),"entry_depth"===J.tightestConstraint&&d.push({id:"axis_inequality",passed:J.entryDepthMargin_mm>=0,values:{item_dim_mm:J.entry.along_depth,space_dim_mm:Q,axis:"entry_depth",margin_mm:J.entryDepthMargin_mm},comparison:{actual_mm:J.entry.along_depth,limit_mm:Q,margin_mm:J.entryDepthMargin_mm},limiting:!0}),J.rotResult.feasible&&d.push(...J.rotResult.proofSteps.map(e=>({...e,limiting:"rotation"===J.tightestConstraint&&e.limiting}))),!d.some(e=>!0===e.limiting)){let e=null;for(let t of d)(null==(m=t.comparison)?void 0:m.margin_mm)!=null&&(!e||t.comparison.margin_mm<e.comparison.margin_mm)&&(e=t);e&&(e.limiting=!0)}let y=J.allPass;d.push(...(0,g.kj)({itemFace:{a_mm:J.entry.across_door,b_mm:J.entry.vertical},spaceFace:{a_mm:V.width_mm,b_mm:V.height_mm},itemReach:{l_mm:J.orientation.l,w_mm:J.orientation.w,h_mm:J.orientation.h},spaceReachDiag_mm:Math.hypot(V.width_mm,V.height_mm),fits:y}));let T=d.find(e=>!0===e.limiting);if(T){let e=(null==(c=T.values)?void 0:c.axis)||("proj_w"===T.id?"door_width":"proj_h"===T.id?"door_height":"limiting");d.push(...(0,g.Ew)({limitingAxis:e,itemDim_mm:T.comparison.actual_mm,spaceDim_mm:T.comparison.limit_mm,tolerance_mm:0}))}return d})(),et=ee.length,en=ee.find(e=>!0===e.limiting),ei=null!=(k=null==en||null==(n=en.comparison)?void 0:n.margin_mm)?k:J.tightestMargin_mm,ea=$.length>1?"Best orientation chosen because its tightest binding step (Step ".concat(et,") clears with the largest combined margin across all six orientations."):null,eo={width:e.length,depth:e.width,height:e.height},er={door_width_mm:V.width_mm,door_height_mm:V.height_mm,cab_width_mm:z.width_mm,cab_depth_mm:z.depth_mm,cab_height_mm:z.height_mm},el=(e,t)=>
1{switch(e){case"door":return"elevator_door";case"cab":return t||"cab";case"entry_depth":return"cab_depth";case"rotation":return"rotation_clearance";default:return e||"elevator"}},es=W.some(e=>e.includes("standard")),em=U&&!H||es?"MEDIUM":"HIGH";if(!J.allPass){let t=$.find(e=>!e.allPass)||J;t.tightestMargin_mm>-51&&0===P&&("door"===t.tightestConstraint&&(null==(F=t.doorResult)?void 0:F.limitingDimension)==="height"?G.push("Close to fitting. Door header, threshold, and frame inset reduce effective height — measure the clear opening precisely."):G.push('Close to fitting. Measure handrails (2-3"/side), wall panels (6-8"), and door jamb depth (2-4") — these may be the difference.')),J.tightestConstraint;let n={staticPlacement:Z,movement:J.rotResult,verdict:"DOESNT_FIT",tone:"definitive",bestOrientation:{across_door_mm:J.entry.across_door,vertical_mm:J.entry.vertical,along_depth_mm:J.entry.along_depth},restingOrientation:{width_mm:J.orientation.w,height_mm:J.orientation.h,depth_mm:J.orientation.l},doorClearance:{method:J.doorResult.method,margin_mm:J.adjustedDoorMargin,geometric_margin_mm:J.doorResult.margin_mm,tiltAngle_deg:J.doorResult.tiltAngle_deg||null,limitingDimension:J.doorResult.limitingDimension,doorDiagonal_mm:J.doorResult.doorDiagonal_mm,doorWidth_mm:V.width_mm,doorHeight_mm:V.height_mm},cabClearance:{...J.cabResult,margin_mm:J.cabResult.margin_mm,fits:J.cabResult.fits,limitingAxis:J.cabResult.limitingAxis,perAxisMargins:J.cabResult.perAxisMargins,effectiveDimensions:J.cabResult.effectiveDimensions,obstructionDeduction_mm:P},rotationClearance:{...J.rotResult,needed:J.rotResult.needed,method:J.rotResult.method,sweepDiagonal_mm:J.rotResult.sweepDiagonal_mm,availableDiagonal_mm:J.rotResult.availableDiagonal_mm,margin_mm:J.rotResult.margin_mm===1/0?null:J.rotResult.margin_mm,feasible:J.rotResult.feasible},tightestConstraint:J.tightestConstraint,tightestMargin_mm:J.tightestMargin_mm,margin_mm:ei,limiting_constraint:el(J.tightestConstraint,null==(N=J.cabResult)?void 0:N.limitingAxis),checked_orientations:X,confidence:em,assumptions:W,warnings:G,needs_user_input:q,tightestPoint:{entityA:"item_".concat("door"===J.tightestConstraint?"cross_section":(null==(x=J.cabResult)?void 0:x.limitingAxis)||"dimension"),entityB:"door"===J.tightestConstraint?"elevator_door":"cab_".concat((null==(E=J.cabResult)?void 0:E.limitingAxis)||"dimension"),axis:"door"===J.tightestConstraint?"door":(null==(D=J.cabResult)?void 0:D.limitingAxis)||"unknown",clearance_mm:ei},geometryClass:"static",enrichedConfidence:W.some(e=>e.includes("standard"))?"medium":"high",enrichedAssumptions:["doorway_unobstructed","item_rigid",...W.some(e=>e.includes("standard"))?["standard_cab_dimensions"]:[]],proofSteps:ee,orientationRationale:ea,itemDims_mm:eo,spaceDims_mm:er};if(!(0,s.Wy)(L)&&j.isSlab&&"DOESNT_FIT"===n.verdict){let t=function(e){let{failingResult:t,item:n,door:i,cab:a,obstructionDeduction_mm:o}=e,[l,m,c]=[n.length,n.width,n.height].sort((e,t)=>e-t);if(l>i.width_mm||m>i.height_mm)return null;let d=[[m,l,c],[c,m,l],[c,l,m]].map(e=>{let[t,n,i]=e;return r(t,n,i,a.width_mm,a.depth_mm,a.height_mm,o)}).filter(e=>e.fits).sort((e,t)=>t.margin_mm-e.margin_mm);return d.length?(0,s.Sp)({...t,staticPlacement:d[0],slabPlacementEvaluated:!0},_.r.GENUINELY_UNDERSPECIFIED,"A static panel placement fits the measured cab. Entry and movement to that pose have not been established."):null}({failingResult:n,item:e,door:V,cab:z,obstructionDeduction_mm:P});if(t)return t}return n}let{verdict:ec,tone:ed}=(0,h.K8)(J.tightestMargin_mm),eh="tilted"===J.doorResult.method&&"DOESNT_FIT"!==ec?"FITS_TILTED":ec;J.tightestMargin_mm<51&&0===P&&G.push('Margin under 2". Measure handrails (2-3"/side), wall panels (6-8"), and door jamb depth (2-4").');let eu="door"===J.tightestConstraint?J.doorResult.limitingDimension:"rotation"===J.tightestConstraint?J.rotResult.bindingAxis.replace("_mm",""):"entry_depth"===J.tightestConstraint?"depth":J.cabResult.limitingAxis;return{verdict:eh,staticPlacement:J.cabResult,movement:J.rotResult,tone:ed,bestOrientation:{across_door_mm:J.entry.across_door,vertical_mm:J.entry.vertical,along_depth_mm:J.entry.along_depth,door_plane_tilt_deg:null!=(C=J.doorResult.tiltAngle_deg)?C:0,pose:null!=(O=null==(l=J.rotResult.witness)?void 0:l.entryPose)?O:null},restingOrientation:{width_mm:J.orientation.w,height_mm:J.orientation.h,depth_mm:J.orientation.l,yaw_deg:null!=(R=null==(m=J.cabResult.witness)?void 0:m.yaw_deg)?R:0,pose:null!=(A=null==(c=J.rotResult.witness)?void 0:c.finalPose)?A:null},doorClearance:{method:J.doorResult.method,margin_mm:J.adjustedDoorMargin,geometric_margin_mm:J.doorResult.margin_mm,tiltAngle_deg:J.doorResult.tiltAngle_deg||null,limitingDimension:J.doorResult.limitingDimension,doorDiagonal_mm:J.doorResult.doorDiagonal_mm,doorWidth_mm:V.width_mm,doorHeight_mm:V.height_mm},cabClearance:{...J.cabResult,margin_mm:J.cabResult.margin_mm,limitingAxis:J.cabResult.limitingAxis,perAxisMargins:J.cabResult.perAxisMargins,effectiveDimensions:J.cabResult.effectiveDimensions,obstructionDeduction_mm:P},rotationClearance:{...J.rotResult,needed:J.rotResult.needed,method:J.rotResult.method,sweepDiagonal_mm:J.rotResult.sweepDiagonal_mm,availableDiagonal_mm:J.rotResult.availableDiagonal_mm,margin_mm:J.rotResult.margin_mm===1/0?null:J.rotResult.margin_mm,feasible:J.rotResult.feasible},tightestConstraint:J.tightestConstraint,tightestMargin_mm:J.tightestMargin_mm,margin_mm:J.tightestMargin_mm,limiting_constraint:el(J.tightestConstraint,J.cabResult.limitingAxis),checked_orientations:X,confidence:em,assumptions:W,warnings:G,needs_user_input:q,tightestPoint:{entityA:"item_".concat(eu),entityB:"door"===J.tightestConstraint?"elevator_door":"cab_".concat(eu),axis:eu,clearance_mm:J.tightestMargin_mm},geometryClass:J.rotResult.needed?"rotational":"static",enrichedConfidence:es?"medium":"high",enrichedAssumptions:["doorway_unobstructed","item_rigid",...es?["standard_cab_dimensions"]:[]],..."tilted"===J.doorResult.method&&J.doorResult.tiltAngle_deg&&{rotationDetail:{requiredAngle_deg:J.doorResult.tiltAngle_deg,effectiveWidth_mm:J.rotResult.witness.entryProjectedDimensions.width_mm,originalWidth_mm:J.orientation.w}},proofSteps:ee,orientationRationale:ea,itemDims_mm:eo,spaceDims_mm:er}}(e=(0,m.Bs)(e),t,S);if("DOESNT_FIT"===k.verdict){let n=Math.min(e.length,e.width,e.height),i=n>t.cab.width_mm||n>t.cab.depth_mm||n>t.cab.height_mm||n>t.door.width_mm||n>t.door.height_mm||"upright"===S.orientationConstraint&&(null==S.maxPitch_deg||0===S.maxPitch_deg||!1===S.allowTilt)&&e.height>t.door.height_mm,a=Math.hypot(e.length,e.width,e.height),o=Math.hypot(t.cab.width_mm,t.cab.depth_mm,t.cab.height_mm);if(i)k.obstruction_proven=!0;else if(a>o+1e-7){let t=Math.round(o-a);k.obstruction_proven=!0,k.obstructionEvidence={kind:"space_diagonal",item_diag_mm:a,space_diag_mm:o},k.margin_mm=k.tightestMargin_mm=t,k.raw_margin_mm=k.effective_margin_mm=t,k.handling_buffer_mm=0,k.limiting_constraint="cab_dimensions",k.tightestConstraint="cab",k.tightestPoint={entityA:"item_diagonal",entityB:"cab_diagonal",axis:"diagonal",clearance_mm:t},k.proofSteps=(k.proofSteps||[]).filter(e=>"space_diagonal"!==e.id).map(e=>({...e,limiting:!1})),k.proofSteps.push({id:"space_diagonal",passed:!1,limiting:!0,values:{item_l_mm:e.length,item_w_mm:e.width,item_h_mm:e.height,item_diag_mm:a,space_diag_mm:o,margin_mm:t},comparison:{actual_mm:a,limit_mm:o,margin_mm:t},note:"Opposite item corners exceed the maximum distance between any two cab points; no orientation can fit."})}else k=(0,s.Sp)(k,_.r.GENUINELY_UNDERSPECIFIED,(null==(w=k.staticPlacement)?void 0:w.fits)?"A static placement fits the measured cab. Entry and movement to that pose have not been established.":"The checked entry and placement strategies did not clear. This does not prove that combined insertion and turning is impossible.")}"UNKNOWN"===k.verdict&&(k=(0,s.Sp)(k,k.unknown_reason)),k.staticPlacement&&(k.staticPlacement={...k.staticPlacement,carryPolicy:{orientationConstraint:null!=(y=S.orientationConstraint)?y:!1===S.allowTilt||null!=S.maxPitch_deg?"upright":null,allowYaw:!1!==S.allowYaw,allowTilt:null!=(T=S.allowTilt)?T:null,maxPitch_deg:null!=(I=S.maxPitch_deg)?I:null}}),k.inputValidation=t.inputValidation,k.continuous_path_proven=!1,(null==(n=k.movement)?void 0:n.witness)&&(k.assumptions=[...k.assumptions||[],...k.movement.limitations]);let N=Object.fromEntries(Object.entries(t.inputValidation.fields).map(e=>{let[t,n]=e;return[t.replace(".","_"),["resolved","assumed"].includes(n.status)?n.value:null]}));return k.accessPathMeasurements=(0,c.S7)(t,null!=(M=k.spaceDims_mm)?M:N).map(e=>{let n=e.key.replace(/^(cab|door)_/,"$1."),i=t.inputValidation.fields[n];return{...e,validationStatus:i.status,evaluationStatus:null==e.value?"unknown":k.spaceDims_mm?"UNKNOWN"===k.verdict?"partially_evaluated":"evaluated":"recorded_but_not_evaluated",constraintRef:n,..."resolved"!==i.status?{note:"Measurement ".concat(i.status,"; confirmation required")}:{}}}),k.accessPathMeasurements.push(...(0,c.Ep)(k)),k}}
1,35150:(e,t,n)=>{n.d(t,{Hv:()=>r,Os:()=>l});var i=n(52616),a=n(68505);function o(){let e=(0,i.$)();try{(0,a.cT)(a.O3.CONVERSATION_ID,e)}catch(e){}return e}function r(){return function(){try{return(0,a.c7)(a.O3.CONVERSATION_ID)||null}catch(e){return null}}()||o()}function l(){return o()}},38072:(e,t,n)=>{n(95155),n(12115),n(55786),n(98934),n(6214),n(61378)},38688:(e,t,n)=>{n.d(t,{solveMoveSize:()=>c});var i=n(16959);let a={studio:{low:200,expected:350,high:600},1:{low:300,expected:450,high:700},2:{low:600,expected:850,high:1200},3:{low:1e3,expected:1250,high:1600},4:{low:1500,expected:1900,high:2400}},o={bedroom:200,"living room":275,"dining room":150,kitchen:150,"home office":150,garage:300,basement:300,"dorm room":65};function r(e){return!e||e<1?null:e>=4?"4":String(e)}function l(e,t,n){return{low:Math.max(0,Math.round(e)),expected:Math.round(t),high:Math.round(n)}}let s={FITS:"FITS",TIGHT_FIT:"TIGHT_FIT",DOESNT_FIT:"DOESNT_FIT",UNKNOWN:"UNKNOWN",CLARIFY:"CLARIFY"};function m(e,t){return t?Math.round((e-t)/t*100):null}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=e||{},n=t.moveProfile||{},c=Number.isFinite(n.bedrooms)?n.bedrooms:null,_="string"==typeof n.dwelling?n.dwelling:null,g=Array.isArray(n.rooms)?n.rooms:null,p=Array.isArray(t.resolvedItems)?t.resolvedItems:null,f=t.family||null,w=Array.isArray(p)&&p.some(e=>Number.isFinite(null==e?void 0:e.volumeCubicFt)&&e.volumeCubicFt>0),v=Array.isArray(g)&&g.length>0,b="studio"===_;if(!c&&!b&&!v&&!w)return d(s.CLARIFY,{reason:"no_anchor"});let y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{bedrooms:t=null,dwelling:n=null,rooms:i=null,resolvedItems:s=null,originMinCuFt:m=null}=e,c=Number.isFinite(m)&&m>0?m:0;if(Array.isArray(s)&&s.length>0){let e=s.filter(e=>Number.isFinite(null==e?void 0:e.volumeCubicFt)),i=e.reduce((e,t)=>e+t.volumeCubicFt,0),o=e.length<s.length,m=Math.max(function(e,t){let n="studio"===t?"studio":r(e),i=n?a[n]:null;return i?i.expected*("house"===t?1.15:1):0}(t,n),c),d=o?Math.max(0,m-i):0,h=i+d,u=o?.3:.1;return{...l(h*(1-u),h,h*(1+u)),confidence:o?"MEDIUM":"HIGH",basis:{tier:"item_list",itemCount:s.length,coveredCount:e.length,partialCoverage:o}}}if(Array.isArray(i)&&i.length>0){let e=i.reduce((e,t)=>{var n,i;return e+(null!=(i=o[null==t||null==(n=t.toLowerCase)?void 0:n.call(t)])?i:o.bedroom)},0)*("house"===n?1.15:1);return{...l(.78*e,e,1.22*e),confidence:"MEDIUM",basis:{tier:"checklist",rooms:i}}}let d=r(t),h="studio"===n;if(h||d&&a[d]){let e=a[h?"studio":d],i="house"===n?1.15:1,o=l(e.low*i,e.expected*i,e.high*i),r=n?"MEDIUM":"LOW";return{...o,confidence:r,basis:{tier:"bedrooms",bedrooms:t,dwelling:n}}}return c>0?{low:Math.round(c),expected:Math.round(1.5*c),high:Math.round(2.5*c),confidence:"LOW",basis:{tier:"origin_space",originMinCuFt:Math.round(c)}}:{low:0,expected:0,high:0,confidence:"LOW",basis:{tier:"none"}}}({bedrooms:c,dwelling:_,rooms:g,resolvedItems:p});if(!y||"none"===y.basis.tier||y.expected<=0)return d(s.UNKNOWN,{band:y,reason:"band_unanchored"});let T=f?(0,i._v)(f):[...i.Gd].sort((e,t)=>e.usableCubicFt-t.usableCubicFt),I=T.find(e=>e.usableCubicFt>=y.expected)||null;if(!I){let e=T[T.length-1],t=Math.max(2,Math.ceil(y.expected/e.usableCubicFt));return{...d(s.DOESNT_FIT,{band:y}),recommended:null,ranked:T,multiLoad:{loads:t,baseClass:e,overflowCubicFt:Math.round(y.expected-e.usableCubicFt)},proofSteps:h(y,e)}}let M=T.indexOf(I),S=T[M+1]||null;return{verdict:I.usableCubicFt>=y.high?s.FITS:s.TIGHT_FIT,confidence:y.confidence,queryType:"move_size",band:y,recommended:{...I,headroomPct:m(I.usableCubicFt,y.expected)},alternative:S,alsoFits:T.filter(e=>e.usableCubicFt>=y.expected&&e.classId!==I.classId),tooSmall:T.filter(e=>e.usableCubicFt<y.expected),ranked:T,multiLoad:null,proofSteps:h(y,I),assumptions:u(y)}}catch(e){return d(s.UNKNOWN,{reason:"exception",error:String((null==e?void 0:e.message)||e)})}}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{verdict:e,confidence:"LOW",queryType:"move_size",band:t.band||null,recommended:null,alternative:null,alsoFits:[],tooSmall:[],ranked:[],multiLoad:null,proofSteps:t.band?h(t.band,null):[],assumptions:u(t.band||null),_meta:t}}function h(e,t){var n,i,a,o,r,l,s;let c=[{id:"volume_estimate",passed:!0,limiting:!1,values:{low_ft3:null!=(i=null==e?void 0:e.low)?i:0,expected_ft3:null!=(a=null==e?void 0:e.expected)?a:0,high_ft3:null!=(o=null==e?void 0:e.high)?o:0,tier:null!=(r=null==e||null==(n=e.basis)?void 0:n.tier)?r:"none"}}];return t&&(c.push({id:"packing_factor",passed:!0,limiting:!1,values:{raw_ft3:t.rawCubicFt,packing_factor:t.packingFactor,usable_ft3:t.usableCubicFt}}),c.push({id:"class_comparison",passed:t.usableCubicFt>=(null!=(l=null==e?void 0:e.expected)?l:1/0),limiting:!0,values:{expected_ft3:null!=(s=null==e?void 0:e.expected)?s:0,usable_ft3:t.usableCubicFt,headroom_pct:m(t.usableCubicFt,null==e?void 0:e.expected)}})),c}function u(e){var t,n;let i=["Class dimensions are typical for the size, not a specific rental company’s exact spec.","Usable cubic-ft applies a per-class packing factor (real-world fill, not raw interior volume)."];return(null==e||null==(t=e.basis)?void 0:t.partialCoverage)&&i.push("Some listed items had no known dimensions; the estimate widens to avoid undercounting."),(null==e||null==(n=e.basis)?void 0:n.tier)==="bedrooms"&&i.push("Based on typical contents for that bedroom count; a fuller-than-average home runs higher."),i}},40441:(e,t,n)=>{n.d(t,{JD:()=>_,Mk:()=>d,e8:()=>h});var i=n(12115);let a="itemfits_unit_pref",o=Object.freeze({system:"imperial",unit:"ft"}),r=null,l=new Set;function s(){try{let e=window.localStorage.getItem(a);if(!e)return null;let{system:t,unit:n}=JSON.parse(e);if(!t||!n)return null;return{system:t,unit:n}}catch(e){return null}}function m(){return null===r&&(r=s()||o),r}function c(){return o}function d(){return s()}function h(e,t){let n=m();if(n.system!==e||n.unit!==t){r={system:e,unit:t};try{window.localStorage.setItem(a,JSON.stringify(r))}catch(e){}
1l.forEach(e=>e())}}function u(e){return l.add(e),()=>{l.delete(e)}}function _(){return(0,i.useSyncExternalStore)(u,m,c)}},44563:(e,t,n)=>{n.d(t,{CA:()=>i});function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(1===n)return e;if("int"===t)return e+(n-1)*1e5;if("string"===t)return"e".concat(n,".").concat(e);throw Error('applyEpoch: unknown kind "'.concat(t,'"'))}},45042:(e,t,n)=>{n.d(t,{solveResidual:()=>d});var i=n(76683),a=n(31587),o=n(27236),r=n(5979),l=n(17192);let s=1/l.KD.in,m=l.KD.in,c=["nightstand","floor lamp","moving box","side table","bookshelf","chair","office chair","coffee table","tv stand","dresser","desk","dining chair","ottoman","bench","console table","wardrobe","recliner","loveseat","sofa"];function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{priorItemNames:l=[],userUnit:d="in",classification:h={}}=n,u=function(e,t){let n;if(!e||!t)return null;let i=t.length||0,a=t.width||0,o=t.height||0;if(i<=0||a<=0)return null;let r=i*a*(o||1),l=function(e){var t;let n=[];if(e.perItemResults){for(let t of e.perItemResults){if("DOESNT_FIT"===t.verdict)continue;let e=t.placedDimensions||t.itemDimensions||t;n.push({length:e.length||e.width_mm||e.width||0,width:e.width||e.depth_mm||e.depth||0,depth:e.depth||e.width||0,height:e.height||e.height_mm||0})}return n}if(null!=e.recommendedCount&&e.item){let t=e.recommendedCount||0;for(let i=0;i<t;i++)n.push({length:e.item.length_mm||0,width:e.item.width_mm||0,depth:e.item.width_mm||0,height:e.item.height_mm||0});return n}let i=e.inputs||e;if((null==(t=i.items)?void 0:t.length)>0){for(let e of i.items)n.push({length:e.length||e.width_mm||0,width:e.width||e.depth_mm||0,depth:e.depth||e.width||0,height:e.height||e.height_mm||0});return n}return i.item&&n.push({length:i.item.length_mm||i.item.length||0,width:i.item.width_mm||i.item.width||0,depth:i.item.width_mm||i.item.width||0,height:i.item.height_mm||i.item.height||0}),n}(e);if(0===l.length)return{length_mm:i,width_mm:a,height_mm:o,volume_mm3:r,isNegligible:!1,isEmpty:!1,usedVolume_mm3:0,utilizationPercent:0};let s=0;for(let e of l){let t=e.length||e.width||0;s+=t*(e.depth||e.length||0)*(e.height||1)}let m=(n="room_fit"===e.queryType||"room"===e.containerType?Math.max(0,i-l.reduce((e,t)=>e+Math.max(t.length||0,t.width||0),0)):Math.max(0,i-l.reduce((e,t)=>e+Math.max(t.length||0,t.width||0),0)))*a*(o||1),c=r>0?Math.round(s/r*100):0,d=n<152||a<152||m<28316,h=n<=0||a<=0;return{length_mm:Math.round(n),width_mm:Math.round(a),height_mm:Math.round(o),volume_mm3:Math.round(m),isNegligible:d,isEmpty:h,usedVolume_mm3:Math.round(s),utilizationPercent:c}}(e,t);if(!u)return{verdict:"UNKNOWN",unknown_reason:o.r.OTHER,queryType:"residual",message:"Unable to compute residual space from prior result."};if(u.isEmpty)return(0,r.H)("residual",{verdict:"FULL",queryType:"residual",residual:u,suggestions:[],message:"The space is effectively full.",classification:h});let _=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||e.isEmpty)return[];let{excludeItems:n=[],userUnit:o="in"}=t,r=new Set(n.map(e=>e.toLowerCase())),l=[];for(let t of c){if(r.has(t.toLowerCase()))continue;let n=(0,i.getItemDimensions)(t);if(!(null==n?void 0:n.dimensions))continue;let s=n.dimensions,c=(s.width||0)*m,d=(s.depth||0)*m,h=(s.height||0)*m;if(c<=0||d<=0||"approximate_soft"===(0,a.NL)(t)&&e.volume_mm3<5e5)continue;let u=c<=e.length_mm&&d<=e.width_mm,_=d<=e.length_mm&&c<=e.width_mm,g=!e.height_mm||h<=e.height_mm;if((u||_)&&g){let i;i=u?Math.min(e.length_mm-c,e.width_mm-d):Math.min(e.length_mm-d,e.width_mm-c),l.push({name:n.name||t,dims_mm:{length:Math.round(c),width:Math.round(d),height:Math.round(h)},dims_display:function(e,t){let n=[];return(e.width&&n.push(e.width),e.depth&&n.push(e.depth),e.height&&n.push(e.height),"cm"===t)?n.map(e=>Math.round(2.54*e)).join('" \xd7 ')+" cm":n.join('" \xd7 ')+'"'}(s,o),fits:!0,margin_mm:Math.round(i)})}}return l.sort((e,t)=>{let n=e.dims_mm.length*e.dims_mm.width*(e.dims_mm.height||1);return t.dims_mm.length*t.dims_mm.width*(t.dims_mm.height||1)-n}),l.slice(0,5)}(u,{excludeItems:l,userUnit:d}),g=(null==h?void 0:h.model)==="approximate_soft";return(0,r.H)("residual",{verdict:u.isNegligible?"NEGLIGIBLE":"HAS_SPACE",queryType:"residual",residual:u,suggestions:_,softDisclaimer:g?"Actual remaining space may vary — soft items can compress further.":null,classification:h,residualDims:{length_in:Math.round(u.length_mm*s*10)/10,width_in:Math.round(u.width_mm*s*10)/10,height_in:u.he
1ight_mm?Math.round(u.height_mm*s*10)/10:null},utilizationPercent:u.utilizationPercent})}},45263:(e,t,n)=>{n.d(t,{FT:()=>function e(t,n){var i,a,o;let r,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=v(t,n,l);if("UNKNOWN"!==s.verdict||(null==(i=s.landingCheck)?void 0:i.status)!=="motion_unverified")return s;if((null!=(a=n.turn_angle)?a:90)===180){let i=n.width_mm,a=null!=(o=n.width_after_mm)?o:n.width_mm,r=[e(t,{...n,turn_angle:90,width_mm:i,width_after_mm:a},l),e(t,{...n,turn_angle:90,width_mm:a,width_after_mm:i},l)];if(r.some(e=>"UNKNOWN"===e.verdict||!Number.isFinite(e.margin_mm)))return s;let m=r[0].margin_mm<=r[1].margin_mm?r[0]:r[1];return{...m,landingCheck:s.landingCheck,accessPathMeasurements:s.accessPathMeasurements,assumptions:[...new Set([...m.assumptions||[],"U-turn landing decomposed into two sequential 90\xb0 turns"])],details:{...m.details,turn_angle:180,u_turn_leg1:{verdict:r[0].verdict,margin_mm:r[0].margin_mm},u_turn_leg2:{verdict:r[1].verdict,margin_mm:r[1].margin_mm}}}}try{r=f(t,n,l)}catch(e){return s}return _.ct.has(null==r?void 0:r.verdict)&&Number.isFinite(r.margin_mm)?{...r,landingCheck:s.landingCheck,accessPathMeasurements:s.accessPathMeasurements,check_scope:"stair_landing_envelope",continuous_path_proven:!1,obstruction_proven:!1,unknown_reason:void 0,needs_user_input:[]}:s},PU:()=>v,e1:()=>w});var i=n(27836),a=n(11189),o=n(41154),r=n(74737),l=n(27236),s=n(89175),m=n(98524),c=n(89609),d=n(73169),h=n(62745),u=n(16979),_=n(87062),g=n(85850);
1function p(e){let{a_mm:t,b_mm:n,bMax_mm:i,across_mm:a,corridorWidth_mm:o,widthMargin_mm:r,along_mm:l,fitsCorner:s,cornerMargin_mm:m,vert_mm:c,ceilingHeight_mm:d,heightMargin_mm:h,landingMargin_mm:u,landingItem_mm:_,landingSpace_mm:p,fits:f,tolerance_mm:w=0}=e,v=[],b=null!=m?m:1/0,y=null!=r?r:null!=a&&null!=o?o-a:1/0,T=null!=h?h:null!=c&&null!=d?d-c:1/0,I=null!=u?u:1/0,M=Math.min(b,y,T,I),S=I===M&&I!==1/0,k=!S&&b===M&&b!==1/0,N=!S&&!k&&y===M&&y!==1/0;if(null!=i&&null!=l&&v.push({id:"moving_rod",passed:!!s,values:{a_mm:t,b_mm:n,b_max_mm:Math.round(i)},comparison:{actual_mm:Math.round(l),limit_mm:Math.round(i),margin_mm:Math.round(null!=m?m:i-l)},limiting:k}),null!=a&&null!=o&&v.push({id:"axis_inequality",passed:y>=0,values:{item_dim_mm:Math.round(a),space_dim_mm:Math.round(o),axis:"corridor_width",margin_mm:Math.round(y)},comparison:{actual_mm:Math.round(a),limit_mm:Math.round(o),margin_mm:Math.round(y)},limiting:N}),null!=c&&null!=d&&v.push({id:"axis_inequality",passed:T>=0,values:{item_dim_mm:Math.round(c),space_dim_mm:Math.round(d),axis:"ceiling_height",margin_mm:Math.round(T)},comparison:{actual_mm:Math.round(c),limit_mm:Math.round(d),margin_mm:Math.round(T)},limiting:!S&&!k&&!N&&T!==1/0}),null!=u&&null!=_&&null!=p&&v.push({id:"axis_inequality",passed:I>=0,values:{item_dim_mm:Math.round(_),space_dim_mm:Math.round(p),axis:"landing_static_footprint",margin_mm:Math.round(I)},comparison:{actual_mm:Math.round(_),limit_mm:Math.round(p),margin_mm:Math.round(I)},limiting:S}),0===v.length)return null;if(v.some(e=>!0===e.limiting)||(v[0].limiting=!0),null!=a&&null!=c&&null!=o&&null!=d){let e=Math.sqrt(o**2+d**2);v.push(...(0,g.kj)({itemFace:{a_mm:a,b_mm:c},spaceFace:{a_mm:o,b_mm:d},itemReach:{l_mm:l,w_mm:a,h_mm:c},spaceReachDiag_mm:e,fits:!!f}))}if(!f){let e=S?_:k?l:N?a:c,t=S?p:k?i:N?o:d;null!=e&&null!=t&&v.push(...(0,g.Ew)({limitingAxis:S?"landing_pivot":k?"corner_sweep":N?"corridor_width":"ceiling_height",itemDim_mm:e,spaceDim_mm:t,tolerance_mm:w}))}return v}function f(e,t){var n,i,o,_,f;let w=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},b=null!=(n=w.tolerance_mm)?n:r.KL.turn;if(!e)return{verdict:"UNKNOWN",unknown_reason:l.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:b,confidence:"LOW",needs_user_input:["Item dimensions (width \xd7 depth \xd7 height)"]};if(!(null==t?void 0:t.width_mm))return{verdict:"UNKNOWN",unknown_reason:l.r.MISSING_SPACE_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_measurements",checked_orientations:[],assumptions:[],tolerance_mm:b,confidence:"LOW",needs_user_input:["Corridor width before turn"],recommendation:"Professional assessment required for turn navigation"};let y=[],T=t.width_mm,I=t.width_after_mm||T;t.width_after_mm||y.push("Assumed equal corridor widths on both sides of turn"),t.inside_corner_mm&&t.inside_corner_mm<I&&(I=t.inside_corner_mm,y.push("Inside corner restricts second corridor to ".concat(I,"mm")));let M=!!(t.landing_w_mm&&t.landing_d_mm),S=t.height_mm;S||(S=r.aA.standard_ceiling.height_mm,y.push("Assumed standard ceiling height: 8 ft"));let k=t.turn_angle||90;if(180===k){let n={...t,turn_angle:90,width_mm:T,width_after_mm:I},i={...t,turn_angle:90,width_mm:I,width_after_mm:T},a=v(e,n,w),o=v(e,i,w),r=[a,o],l=r.find(e=>e.obstruction_proven)||r.find(e=>"UNKNOWN"===e.verdict)||(a.margin_mm<=o.margin_mm?a:o);return{...l,assumptions:[...new Set([...y,"U-turn decomposed into two sequential 90\xb0 turns",...l.assumptions])],details:{...l.details,turn_angle:180,u_turn_leg1:{corridor_width_before_mm:T,corridor_width_after_mm:I,verdict:a.verdict,margin_mm:a.margin_mm},u_turn_leg2:{corridor_width_before_mm:I,corridor_width_after_mm:T,verdict:o.verdict,margin_mm:o.margin_mm}}}}if(90!==k)return{verdict:"UNKNOWN",unknown_reason:l.r.UNSUPPORTED_QUERY_TYPE,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"unsupported_turn_angle",checked_orientations:[],assumptions:["Turn angle is ".concat(k,"\xb0 — only 90\xb0 and 180\xb0 turns are solved geometrically")],tolerance_mm:b,confidence:"LOW",recommendation:"Professional assessment required for non-standard turn angles",details:{turn_angle:k,corridor_width_before_mm:T,corridor_width_after_mm:I}};
1let N=null!=(i=w.orientationConstraint)?i:!1===w.allowTilt||null!=w.maxPitch_deg?"upright":null,x=(0,m.Rw)(e);if(0===x.length)return{verdict:"UNKNOWN",unknown_reason:l.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"insufficient_item_dimensions",checked_orientations:[],assumptions:y,tolerance_mm:b,confidence:"LOW",needs_user_input:["Complete item dimensions (width \xd7 depth \xd7 height)"]};if(!(x=(0,c.sH)(x,N,e,{strict:!0})).length)return(0,a.Sp)({needs_user_input:["Complete dimensions and supported carry orientation"]});if(N&&y.push("Only checking orientations where the item is ".concat({upright:"upright",flat:"flat",on_side:"on its side"}[N]||N," (as requested).")),x.every(e=>null==e.alongHallway))return{verdict:"UNKNOWN",unknown_reason:l.r.MISSING_THIRD_DIMENSION,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_along_dimension",checked_orientations:[],assumptions:[...y,"Only 2 of 3 item dimensions provided — corner sweep cannot be evaluated"],tolerance_mm:b,confidence:"LOW",needs_user_input:["Item third dimension (width/depth/height) — required for turn analysis"],recommendation:"All three item dimensions are needed to determine if it can navigate a turn"};let E="cylinder"===e.shape?(0,u.nx)(e,"cylinder"):{isCylinder:!1};if(E.isCylinder&&(!N||"upright"===N)){let e=(0,u.yt)(E.diameter_mm,E.height_mm)[0],t=e.vertical<=S,n=(0,u.gq)(e.sweepRadius,T,I);if(t&&n.fits){let t=S-e.vertical,i=Math.min(n.margin_mm,t),{verdict:a}=(0,s.K8)(i);y.push("Item treated as cylindrical — circle navigates corners trivially.");let o=p({a_mm:T,b_mm:I,bMax_mm:null,across_mm:E.diameter_mm,corridorWidth_mm:Math.min(T,I),widthMargin_mm:n.margin_mm,along_mm:null,fitsCorner:!0,cornerMargin_mm:null,vert_mm:e.vertical,ceilingHeight_mm:S,heightMargin_mm:t,fits:!0,tolerance_mm:b});return{verdict:a,margin_mm:Math.round(i),limiting_constraint:n.margin_mm<t?"corridor_width":"ceiling_height",proofSteps:o,checked_orientations:[{orientation:"".concat(e.acrossHallway,"mm across, ").concat(e.vertical,"mm vertical, ").concat(e.alongHallway,"mm along (cylinder upright)"),dimensions_mm:{across:e.acrossHallway,vertical:e.vertical,along:e.alongHallway},feasible:!0,margin_mm:Math.round(i),width_margin_mm:n.margin_mm,height_margin_mm:Math.round(t),corner_margin_mm:n.margin_mm,limiting:n.margin_mm<t?"corridor_width":"ceiling_height"}],assumptions:y,tolerance_mm:b,confidence:"HIGH",search_space_exhausted:!0,method:"cylinder_sweep",tightestPoint:{entityA:"cylinder_diameter",entityB:n.margin_mm<t?"corridor_width":"ceiling_height",axis:n.margin_mm<t?"width":"height",clearance_mm:Math.round(i)},geometryClass:"corner",enrichedConfidence:"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_cylindrical"],details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,turn_angle:k,cylinder_diameter_mm:E.diameter_mm,cylinder_height_mm:E.height_mm,best_orientation:{across_hallway_mm:e.acrossHallway,vertical_mm:e.vertical,along_hallway_mm:e.alongHallway},width_clearance_mm:n.margin_mm,height_clearance_mm:Math.round(t),binding_constraint:n.margin_mm<t?"corridor_width":"ceiling_height"}}}}let D=Math.min(T,I),F=Math.min(...x.map(e=>e.acrossHallway));if(F>D){let e=F-D,t=x.map(e=>({orientation:"".concat(Math.round(e.acrossHallway),"mm across, ").concat(Math.round(e.vertical),"mm vertical, ").concat(null!=e.alongHallway?Math.round(e.alongHallway):"?","mm along"),dimensions_mm:{across:e.acrossHallway,vertical:e.vertical,along:e.alongHallway},feasible:!1,margin_mm:Math.round(D-e.acrossHallway),width_margin_mm:Math.round(D-e.acrossHallway),height_margin_mm:Math.round(S-e.vertical),corner_margin_mm:null,limiting:"corridor_width"})),n=[...x].sort((e,t)=>e.acrossHallway-t.acrossHallway)[0],i=p({a_mm:T,b_mm:I,bMax_mm:null,across_mm:n.acrossHallway,corridorWidth_mm:D,widthMargin_mm:D-n.acrossHallway,along_mm:n.alongHallway,fitsCorner:!1,cornerMargin_mm:null,vert_mm:n.vertical,ceilingHeight_mm:S,heightMargin_mm:S-n.vertical,fits:!1,tolerance_mm:b}),a=null==i?void 0:i.find(e=>!0===e.limiting),r=null!=(f=null==a||null==(o=a.comparison)?void 0:o.margin_mm)?f:Math.round(-e),l=(null==a||null==(_=a.values)?void 0:_.axis)==="ceiling_height"?"ceiling_height":"corridor_width";return{verdict:"DOESNT_FIT",margin_mm:r,limiting_constraint:l,checked_orientations:t,proofSteps:i,assumptions:y,tolerance_mm:b,confidence:"HIGH",search_space_exhausted:!0,method:"short_circuit_width",tightestPoint:{entityA:"ceiling_height"===l?"item_height":"item_width",entity
1B:l,axis:"ceiling_height"===l?"height":"width",clearance_mm:r},geometryClass:"corner",details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,turn_angle:k,binding_constraint:l,short_circuit:!0,min_item_dimension_mm:F,corridor_width_mm:D,closest_orientation:{across_hallway_mm:n.acrossHallway,vertical_mm:n.vertical,along_hallway_mm:n.alongHallway,width_margin_mm:Math.round(D-n.acrossHallway),height_margin_mm:Math.round(S-n.vertical),corner_margin_mm:null}}}}let C=x.map(e=>{let n=e.acrossHallway,i=e.vertical,a=e.alongHallway,o=T-n,r=I-n,l=Math.min(o,r),s=l>=0,m=S-i,d=m>=0,h=null,u=null,_=!1;s&&null!=a?null!=(u=(0,c.fI)(n,T,I))?_=(h=u-a)>=0:(u=0,h=-a,_=!1):s&&null==a&&(_=!1,h=-999);let g=null,p=!0,f=null,w=null;if(M){let e=function(e,t){let{a_mm:n,b_mm:i}=e,{landing_w_mm:a,landing_d_mm:o}=t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=Math.max(n,i),s=Math.min(n,i),m=Math.min(a,o),c=Math.max(a,o),d=Math.min(c-l,m-s)-r;return{fits:d>=0,margin_mm:Math.round(d),longSide:l,shortSide:s,landMin:m,landMax:c,scope:"legacy_static_rectangle_only",pivot_proven:!1}}({a_mm:n,b_mm:null!=a?a:n},{landing_w_mm:t.landing_w_mm,landing_d_mm:t.landing_d_mm},b);g=e.margin_mm,p=e.fits;let i=e.landMax-e.longSide<=e.landMin-e.shortSide;f=i?e.longSide:e.shortSide,w=i?e.landMax:e.landMin}let v=s&&d&&_&&p,y=[l,m];null!=h&&y.push(h),null!=g&&y.push(g);let k=Math.min(...y),N=[{name:"corridor_width",margin:l},{name:"ceiling_height",margin:m}];null!=h&&N.push({name:"corner_sweep",margin:h}),null!=g&&N.push({name:"landing_pivot",margin:g}),N.sort((e,t)=>e.margin-t.margin);let x=N[0].name;return{...e,w1Margin:o,w2Margin:r,widthMargin:l,heightMargin:m,cornerMargin:h,landingMargin:g,landingItem:f,landingSpace:w,bMax:u,fitsWidth:s,fitsHeight:d,fitsCorner:_,fitsLanding:p,feasible:v,limitingMargin:k,limitingConstraint:x}});if(M){let e=Math.max(...C.map(e=>{var t;return null!=(t=e.landingMargin)?t:-1/0}));y.push(e>=0?"Static footprint clears the ".concat(t.landing_w_mm,"\xd7").concat(t.landing_d_mm,"mm landing"):"Static footprint does not clear the ".concat(t.landing_w_mm,"\xd7").concat(t.landing_d_mm,"mm landing"))}let O=C.filter(e=>e.feasible),R=C.map(e=>({orientation:"".concat(Math.round(e.acrossHallway),"mm across, ").concat(Math.round(e.vertical),"mm vertical, ").concat(null!=e.alongHallway?Math.round(e.alongHallway):"?","mm along"),dimensions_mm:{across:e.acrossHallway,vertical:e.vertical,along:e.alongHallway},feasible:e.feasible,margin_mm:Math.round(e.limitingMargin),width_margin_mm:Math.round(e.widthMargin),height_margin_mm:Math.round(e.heightMargin),corner_margin_mm:null!=e.cornerMargin?Math.round(e.cornerMargin):null,limiting:e.limitingConstraint}));if(!(0,a.Wy)(w)&&0===O.length){let t=[];for(let e of C){if(!e.fitsWidth||!e.fitsHeight||e.fitsCorner||!e.fitsLanding||null==e.alongHallway)continue;let n=e.alongHallway,i=e.vertical,a=e.acrossHallway,o=Math.sqrt(n*n+i*i);if(S>=o)continue;let r=S/o;if(r>=1||r<=0)continue;let l=Math.asin(r)-Math.atan2(i,n);if(l<=.02)continue;let s=n*Math.cos(l),m=n*Math.sin(l)+i*Math.cos(l),d=(0,c.fI)(a,T,I);if(null==d)continue;let h=d-s;if(h<0)continue;let u=S-m,_=Math.min(e.widthMargin,h,Math.max(0,u));t.push({...e,tiltAngleDeg:Math.round(180/Math.PI*l),effectiveAlong:Math.round(s),effectiveHeight:Math.round(m),cornerMargin:h,tiltCeilingMargin:u,limitingMargin:_,bMax:d})}if(t.length>0){t.sort((e,t)=>t.limitingMargin-e.limitingMargin);let n=t[0],{verdict:i}=(0,s.K8)(n.limitingMargin);y.push("Item tilted ~".concat(n.tiltAngleDeg,"\xb0 during corner navigation (one end raised toward ceiling)"));let a=[];n.limitingMargin<b&&a.push("Clearance (".concat(Math.round(n.limitingMargin),"mm) is below recommended minimum (").concat(b,"mm)")),a.push("Tilting during corner navigation requires 2+ people");
1let o=function(e){let{a_mm:t,b_mm:n,bMax_mm:i,across_mm:a,corridorWidth_mm:o,effectiveAlong_mm:r,cornerMargin_mm:l,along_mm:s,vert_mm:m,tiltAngleDeg:c,effectiveHeight_mm:d,ceilingHeight_mm:h,fits:u,tolerance_mm:_=0}=e,p=h-d,f=[{id:"moving_rod",passed:l>=0,values:{a_mm:t,b_mm:n,b_max_mm:Math.round(i)},comparison:{actual_mm:Math.round(r),limit_mm:Math.round(i),margin_mm:Math.round(l)},limiting:!1},{id:"tilt_in_corner",passed:p>=0,values:{along_mm:s,vert_mm:m,theta_deg:c,eff_height_mm:Math.round(d)},comparison:{actual_mm:Math.round(d),limit_mm:h,margin_mm:Math.round(p)},limiting:!0}];if(null!=a&&null!=m&&null!=o&&null!=h){let e=Math.sqrt(o**2+h**2);f.push(...(0,g.kj)({itemFace:{a_mm:a,b_mm:m},spaceFace:{a_mm:o,b_mm:h},itemReach:{l_mm:s,w_mm:a,h_mm:m},spaceReachDiag_mm:e,fits:!!u}))}return u||f.push(...(0,g.Ew)({limitingAxis:"tilt_ceiling_envelope",itemDim_mm:d,spaceDim_mm:h,tolerance_mm:_})),f}({a_mm:T,b_mm:I,bMax_mm:n.bMax,across_mm:n.acrossHallway,corridorWidth_mm:Math.min(T,I),effectiveAlong_mm:n.effectiveAlong,cornerMargin_mm:n.cornerMargin,along_mm:n.alongHallway,vert_mm:n.vertical,tiltAngleDeg:n.tiltAngleDeg,effectiveHeight_mm:n.effectiveHeight,ceilingHeight_mm:S,fits:"DOESNT_FIT"!==i,tolerance_mm:b});return{verdict:i,margin_mm:Math.round(n.limitingMargin),limiting_constraint:n.cornerMargin<n.widthMargin?"corner_sweep":"corridor_width",checked_orientations:R,proofSteps:o,orientationRationale:"Selected the orientation whose tilt-in-corner clearance (Step 2) is highest after the moving-rod constraint (Step 1) is honored.",itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{corridor_before_mm:T,corridor_after_mm:I,ceiling_height_mm:S},assumptions:y,tolerance_mm:b,confidence:y.length>2?"MEDIUM":"HIGH",search_space_exhausted:!0,method:"corner_sweep_tilted",tightestPoint:{entityA:"item_sweep_radius",entityB:"inner_corner",axis:"diagonal",clearance_mm:Math.round(n.limitingMargin)},geometryClass:"corner",enrichedConfidence:y.length>2?"medium":"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],maneuverDetail:{requiredAngle_deg:90,sweepRadius_mm:null!=n.bMax?Math.round(n.bMax):null},rotationDetail:{requiredAngle_deg:n.tiltAngleDeg,effectiveWidth_mm:n.effectiveAlong,originalWidth_mm:n.alongHallway},details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,turn_angle:k,rotationNeeded:"tilted ~".concat(n.tiltAngleDeg,"\xb0 at corner"),tilt_angle_deg:n.tiltAngleDeg,effective_horizontal_length_mm:n.effectiveAlong,effective_vertical_height_mm:n.effectiveHeight,best_orientation:{across_hallway_mm:n.acrossHallway,vertical_mm:n.vertical,along_hallway_mm:n.alongHallway},width_clearance_mm:Math.round(n.widthMargin),corner_margin_mm:Math.round(n.cornerMargin),bmax_mm:null!=n.bMax?Math.round(n.bMax):null,binding_constraint:"corner_sweep_with_tilt",lCorner:{fits:!0,corner_margin_mm:Math.round(n.cornerMargin),bmax_mm:null!=n.bMax?Math.round(n.bMax):null,along_mm:n.effectiveAlong,best_orientation:{across_hallway_mm:n.acrossHallway,vertical_mm:n.vertical,along_hallway_mm:n.alongHallway}}},warnings:a}}let n=[];for(let t of C){if(!t.fitsWidth||!t.fitsHeight||t.fitsCorner||!t.fitsLanding||null==t.alongHallway)continue;let i=(0,d.R$)(e,[{type:"corridor_bounds",width_mm:Math.min(T,I),height_mm:S}]);if(!i.feasible)continue;let a=(0,d.rm)(e,i.baseFace),o=(0,d.vr)(a,i.bestAngle.alpha_deg,i.bestAngle.beta_deg).map(e=>e[2]),r=Math.max(...o)-Math.min(...o),l=(0,c.fI)(t.acrossHallway,T,I);if(null==l||r>l)continue;let s=l-r,m=Math.min(t.widthMargin,t.heightMargin,s);n.push({...t,ctResult:i,effectiveAlong:Math.round(r),cornerMargin:s,overallMargin:m,bMax:l})}if(n.length>0){n.sort((e,t)=>t.overallMargin-e.overallMargin);let t=n[0],i=(0,h.Oq)(t.ctResult,e),{warnings:a,assumptions:o}=(0,h.D7)(i,null==w.doorDepth_mm);return y.push(...o),{verdict:i.adjustedVerdict,margin_mm:Math.round(t.overallMargin),limiting_constraint:t.cornerMargin<t.widthMargin?"corner_sweep":"corridor_width",checked_orientations:R,proofSteps:i.proofSteps,orientationRationale:i.orientationRationale,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{corridor_before_mm:T,corridor_after_mm:I,ceiling_height_mm:S},assumptions:y,tolerance_mm:b,confidence:y.length>2?"MEDIUM":"HIGH",search_space_exhausted:!0,method:"compound_tilt",tightestPoint:{entityA:"item_sweep_radius",entity
1B:"inner_corner",axis:"diagonal",clearance_mm:Math.round(t.overallMargin)},geometryClass:"compound_rotational",enrichedConfidence:y.length>2?"medium":"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],maneuverDetail:{requiredAngle_deg:90,sweepRadius_mm:null!=t.bMax?Math.round(t.bMax):null},details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,turn_angle:k,rotationNeeded:"compound tilt ~".concat(i.pitch_deg,"\xb0 pitch, ~").concat(i.yaw_deg,"\xb0 yaw at corner"),effective_horizontal_length_mm:t.effectiveAlong,compoundTiltDetail:i,best_orientation:{across_hallway_mm:t.acrossHallway,vertical_mm:t.vertical,along_hallway_mm:t.alongHallway},width_clearance_mm:Math.round(t.widthMargin),corner_margin_mm:Math.round(t.cornerMargin),bmax_mm:null!=t.bMax?Math.round(t.bMax):null,binding_constraint:"corner_sweep_with_compound_tilt"},warnings:[...a,"Compound tilt during corner navigation requires 2+ people"]}}let i=[...C].sort((e,t)=>t.limitingMargin-e.limitingMargin)[0],a=p({a_mm:T,b_mm:I,bMax_mm:i.bMax,across_mm:i.acrossHallway,corridorWidth_mm:D,widthMargin_mm:i.widthMargin,along_mm:i.alongHallway,fitsCorner:i.fitsCorner,cornerMargin_mm:i.cornerMargin,vert_mm:i.vertical,ceilingHeight_mm:S,heightMargin_mm:i.heightMargin,landingMargin_mm:i.landingMargin,landingItem_mm:i.landingItem,landingSpace_mm:i.landingSpace,fits:!1,tolerance_mm:b});return{verdict:"DOESNT_FIT",margin_mm:Math.round(i.limitingMargin),limiting_constraint:i.limitingConstraint,checked_orientations:R,proofSteps:a,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{corridor_before_mm:T,corridor_after_mm:I,ceiling_height_mm:S},assumptions:y,tolerance_mm:b,confidence:"HIGH",search_space_exhausted:!0,tightestPoint:{entityA:"corner_sweep"===i.limitingConstraint?"item_sweep_radius":"item_".concat("corridor_width"===i.limitingConstraint?"width":"height"),entityB:"corner_sweep"===i.limitingConstraint?"inner_corner":"corridor_width"===i.limitingConstraint?"corridor_width":"ceiling_height",axis:"corner_sweep"===i.limitingConstraint?"diagonal":"corridor_width"===i.limitingConstraint?"width":"height",clearance_mm:Math.round(i.limitingMargin)},geometryClass:"corner",enrichedConfidence:"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,binding_constraint:i.limitingConstraint,bmax_mm:null!=i.bMax?Math.round(i.bMax):null,closest_orientation:{across_hallway_mm:i.acrossHallway,vertical_mm:i.vertical,along_hallway_mm:i.alongHallway,width_margin_mm:Math.round(i.widthMargin),height_margin_mm:Math.round(i.heightMargin),corner_margin_mm:null!=i.cornerMargin?Math.round(i.cornerMargin):null,bmax_mm:null!=i.bMax?Math.round(i.bMax):null}}}}let A=[...O].sort((e,t)=>t.limitingMargin-e.limitingMargin)[0],{verdict:L}=(0,s.K8)(A.limitingMargin),P=[];A.limitingMargin<b&&P.push("Clearance (".concat(Math.round(A.limitingMargin),"mm) is below recommended minimum (").concat(b,"mm)")),null!=A.cornerMargin&&A.cornerMargin<50&&P.push("Very tight corner clearance — professional movers recommended");let U=p({a_mm:T,b_mm:I,bMax_mm:A.bMax,across_mm:A.acrossHallway,corridorWidth_mm:D,widthMargin_mm:A.widthMargin,along_mm:A.alongHallway,fitsCorner:A.fitsCorner,cornerMargin_mm:A.cornerMargin,vert_mm:A.vertical,ceilingHeight_mm:S,heightMargin_mm:A.heightMargin,landingMargin_mm:A.landingMargin,landingItem_mm:A.landingItem,landingSpace_mm:A.landingSpace,fits:"DOESNT_FIT"!==L,tolerance_mm:b}),H=R.length>1?"Best orientation chosen because its moving-rod check (Step 1) clears with the largest margin among all six orientations.":null;return{verdict:L,margin_mm:Math.round(A.limitingMargin),limiting_constraint:A.limitingConstraint,checked_orientations:R,proofSteps:U,orientationRationale:H,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{corridor_before_mm:T,corridor_after_mm:I,ceiling_height_mm:S},assumptions:y,tolerance_mm:b,confidence:y.length>1?"MEDIUM":"HIGH",search_space_exhausted:!0,method:"corner_sweep",tightestPoint:{entityA:"corner_sweep"===A.limitingConstraint?"item_sweep_radius":"item_".concat("corridor_width"===A.limitingConstraint?"width":"height"),entityB:"corner_sweep"===A.limitingConstraint?"inner_corner":"corridor_width"===A.limitingConstraint?"corridor_width":"ceiling_height",axis:"corner_sweep"===A.limitingConstraint?"diagonal":"corridor_width"===A.limitingConstraint?"width":"height",clearance_mm:Math.round(A.limitingMargin)},geometryClass:"corner",enrichedConfidence:y.length>1?"medium":"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],maneuverDetail:{requiredAngle_deg:90,sweepRadius_mm:null!=A.bMax?Math.round(A.bMax):null},details:{corridor_width_before_mm:T,corridor_width_after_mm:I,ceiling_height_mm:S,turn_angle:k,best_orientation:{across_hallway_mm:A.acrossHallway,vertical_mm:A.vertical,along_hallway_mm:A.alongHallway},width_clearance_mm:Math.round(A.widthMargin),height_clearance_mm:Math.round(A.heightMargin),corner_margin_mm:null!=A.cornerMargin?Math.round(A.cornerMargin):null,bmax_mm:null!=A.bMax?Math.round(A.bMax):null,binding_constraint:A.limitingConstraint,lCorner:{fits:!0,corner_margin_mm:null!=A.cornerMargin?Math.round(A.cornerMargin):null,bmax_mm:null!=A.bMax?Math.round(A.bMax):null,along_mm:A.alongHallway,best_orientation:{across_hallway_mm:A.acrossHallway,vertical_mm:A.vertical,along_hallway_mm:A.alongHallway}}},warnings:P.length>0?P:void 0}}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if((null==e?void 0:e.width_mm)>0||n.push("Item width"),(null==e?void 0:e.depth_mm)>
10||n.push("Item length"),(null==e?void 0:e.height_mm)>0||n.push("Item height"),n.length)return{verdict:"NEEDS_DIMENSIONS",needs_user_input:n,reason:"Need the item’s full width, length and height to compute the corridor width required to turn it."};let i=t.ceilingHeight_mm||r.aA.standard_ceiling.height_mm,{orientationConstraint:a=null}=t,o=t=>v(e,{type:"turn",width_mm:t,height_mm:i,turn_angle:90},{tolerance_mm:0,orientationConstraint:a}),l=e=>{let t=o(e);return"number"==typeof t.margin_mm&&t.margin_mm>=0},s=Math.hypot(e.width_mm,e.depth_mm),m=t.maxWidth_mm||Math.ceil(2*s)+e.depth_mm,c=Math.min(m,Math.ceil(s)+50);for(;!l(c)&&c<m;)c=Math.min(m,2*c);if(!l(c)){let t=o(c);return{verdict:"WIDTH_WONT_RESOLVE",limiting_constraint:t.limiting_constraint||"non_width_constraint",checkedWidth_mm:c,ceilingHeight_mm:i,item:e,boundaryProbe:t,assumptions:["Even a ".concat(Math.round(c),"mm-wide corridor does not allow this 90\xb0 turn")]}}let d=0;for(;c-d>1;){let e=Math.floor((d+c)/2);l(e)?c=e:d=e}return{verdict:"REQUIRED_WIDTH",requiredWidth_mm:c,turn_angle:90,ceilingHeight_mm:i,item:e,boundaryProbe:o(c),assumptions:["Assumed equal corridor widths on both sides of the turn"]}}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=function(e,t){var n,i;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((null==t?void 0:t.landing_w_mm)!=null||(null==t?void 0:t.landing_d_mm)!=null){let i=function(e,t){var n,i,s,m,c,d,h,u,_,g,p,f,w,v;let b=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},y=null!=(n=(b=(0,o.w0)(t,b)).tolerance_mm)?n:r.KL.turn,T={incoming:t.width_mm,outgoing:null!=(i=t.width_after_mm)?i:t.width_mm,width:t.landing_w_mm,depth:t.landing_d_mm,height:t.height_mm},I={incoming:null!=(s=t.incoming_rail_deduction_mm)?s:0,outgoing:null!=(m=t.outgoing_rail_deduction_mm)?m:0,width:null!=(c=t.landing_rail_width_mm)?c:0,depth:null!=(d=t.landing_rail_depth_mm)?d:0,height:0},M=Object.values(T).every(e=>Number.isFinite(e)&&e>0)&&Object.values(I).every(e=>Number.isFinite(e)&&e>=0)&&Number.isFinite(y)&&y>=0&&[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm].every(e=>Number.isFinite(e)&&e>0)&&Number.isFinite(null!=(h=t.turn_angle)?h:90)&&(null!=(u=t.turn_angle)?u:90)>0&&(null!=(_=t.turn_angle)?_:90)<=180,S=M?Object.fromEntries(Object.keys(T).map(e=>[e,T[e]-I[e]-y])):null,{width_mm:k,depth_mm:N,height_mm:x}=null!=e?e:{},E=[[k,N,x],[N,k,x],[k,x,N],[x,k,N],[N,x,k],[x,N,k]].map(e=>{let[t,n,i]=e;return{acrossHallway:t,alongHallway:n,vertical:i}}),D=M?(0,a.vn)(E,b,e).map(e=>{let t={incoming:S.incoming-e.acrossHallway,outgoing:S.outgoing-e.acrossHallway,width:S.width-e.acrossHallway,depth:S.depth-e.alongHallway,height:S.height-e.vertical},n=["width","depth","height"],i=n.reduce((e,n)=>t[e]<=t[n]?e:n);return{dimensions_mm:{width:e.acrossHallway,depth:e.alongHallway,height:e.vertical},margins_mm:t,limiting_landing_axis:i,aligned_rectangle_contains:n.every(e=>t[e]>=0),independent_flight_widths_clear:t.incoming>=0&&t.outgoing>=0}}):[],F={model:"landing-input-checkpoint/1",scope:"independent_aligned_checkpoints",status:M?"motion_unverified":"invalid_or_missing_inputs",nominal_mm:T,rail_deductions_mm:I,effective_mm:S,handling_buffer_mm:y,clearance_owner:"landing_checkpoint",numerical_tolerance_mm:0,turn_angle_deg:null!=(g=t.turn_angle)?g:90,input_sources:null!=(p=t.landingInputSources)?p:{outgoing:null==t.width_after_mm?"assumed_equal_incoming":"provided"},pose_constraints:Object.fromEntries(["orientationConstraint","allowYaw","allowTilt","maxPitch_deg"].filter(e=>null!=b[e]).map(e=>[e,b[e]])),obstacles:null!=(f=t.obstacles)?f:[],rails:null!=(w=t.rails)?w:[],obstacle_evaluation_status:"recorded_but_not_evaluated",comparisons:D,continuous_path_proven:!1,pivot_proven:!1,limitations:["Aligned rectangle comparisons exclude unmodeled obstacles and rail shapes; only explicit total edge-strip deductions are applied to the landing.","Independent flight width checks do not establish entry/exit pose compatibility.","Continuous landing rotation and adjoining-flight intrusion remain unverified."]},C=!Array.isArray(F.obstacles)||!Array.isArray(F.rails)||F.obstacles.length>0||F.rails.length>0,O=M&&!C&&!1!==b.allowYaw?D.map(e=>{var n;let i=function(e,t,n){let{width:i,depth:a,height:o}=e;if(![i,a,o,null==t?void 0:t.width,null==t?void 0:t.depth,null==t?void 0:t.height].every(e=>Number.isFinite(e)&&e>0)||!Number.isFinite(n)||n<=0||n>180)return null;let r=n*Math.PI/180,l=[...new Set([0,r,Math.PI/2,Math.atan2(a,i),Math.atan2(i,a),Math.PI-Math.atan2(a,i),Math.PI-Math.atan2(i,a)].filter(e=>e>=0&&e<=r).sort((e,t)=>
1e-t))].map(e=>({yaw_rad:e,width:i*Math.abs(Math.cos(e))+a*Math.abs(Math.sin(e)),depth:i*Math.abs(Math.sin(e))+a*Math.abs(Math.cos(e))})),s=Object.fromEntries(["width","depth"].map(e=>{let t=l.reduce((t,n)=>t[e]>=n[e]?t:n);return[e,{extent_mm:t[e],yaw_rad:t.yaw_rad}]})),m={width:t.width-s.width.extent_mm,depth:t.depth-s.depth.extent_mm,height:t.height-o},c=Object.values(m).every(e=>e>=0);return{model:"landing-contained-pivot/1",scope:"fixed_center_empty_effective_rectangle",status:c?"contained":"construction_does_not_clear",dimensions_mm:{width:i,depth:a,height:o},effective_mm:{...t},center_mm:{x:t.width/2,y:t.depth/2,z:o/2},start_pose:{yaw_rad:0,pitch_rad:0,roll_rad:0},end_pose:{yaw_rad:r,pitch_rad:0,roll_rad:0},angular_interval_rad:[0,r],extrema:s,margins_mm:m,critical_projections:l,numerical_tolerance_mm:0,pivot_proven:c,route_proven:!1}}(e.dimensions_mm,S,null!=(n=t.turn_angle)?n:90);return i?{...i,endpoint_widths:{incoming_mm:e.dimensions_mm.width,outgoing_mm:e.dimensions_mm.width,incoming_margin_mm:e.margins_mm.incoming,outgoing_margin_mm:e.margins_mm.outgoing,compatible_widths:e.independent_flight_widths_clear},entry_exit_status:"connection_geometry_unverified"}:null}).filter(Boolean):[];return F.containedPivot={model:"landing-contained-pivot/1",status:M?C?"unsupported_obstacles_or_rails":!1===b.allowYaw?"yaw_disallowed":O.some(e=>e.pivot_proven)?"contained_witness":"construction_does_not_clear":"invalid_or_missing_inputs",attempts:O,pivot_proven:O.some(e=>e.pivot_proven),entry_exit_proven:!1,route_proven:!1,region_assumption:"empty_effective_rectangle",topology_evaluation_status:"recorded_but_not_evaluated",topology_inputs:Object.fromEntries(["inside_corner_mm","connections","approach_layout","exit_layout","approach_side","exit_side","opening_offset_mm","wall_depth_mm"].filter(e=>null!=t[e]).map(e=>[e,t[e]])),limitations:["Fixed-center yaw only, wholly inside an empty effective rectangular landing; no pitch or flight intrusion.","Flight widths alone do not locate connections or prove translation into or out of the landing.","Failure of this construction does not rule out paths using adjoining regions or other centers."]},F.limitations[2]="A separately scoped contained-pivot witness does not establish adjoining-flight passage.",(0,a.Sp)({landingCheck:F,tolerance_mm:y,check_scope:"landing_checkpoint_only",needs_user_input:M?["A supported landing motion and entry/exit geometry"]:["Positive finite item dimensions, landing width/depth/headroom and flight widths; nonnegative rail and handling deductions"]},M?[90,180].includes(null!=(v=t.turn_angle)?v:90)?l.r.GENUINELY_UNDERSPECIFIED:l.r.UNSUPPORTED_QUERY_TYPE:l.r.MISSING_SPACE_DIMS,"We checked the landing's size, but couldn't show the item turning on it and carrying on. That doesn't prove it can't.")}(e,t,s),m=Math.min(null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm),c=Math.min(t.width_mm,null!=(n=t.width_after_mm)?n:t.width_mm);if(Number.isFinite(m)&&m>0&&Number.isFinite(c)&&c>0&&m>c){let n=f(e,{...t,landing_w_mm:void 0,landing_d_mm:void 0},s);if("DOESNT_FIT"===n.verdict)return{...n,obstruction_proven:!0,landingCheck:i.landingCheck,continuous_path_proven:!1,check_scope:"flight_width_obstruction"}}return i}let m=f(e,t,s);if("DOESNT_FIT"===m.verdict){if(!(m.obstruction_proven||Math.min(null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm)>Math.min(null==t?void 0:t.width_mm,null!=(i=null==t?void 0:t.width_after_mm)?i:1/0)))return(0,a.Sp)(m,l.r.GENUINELY_UNDERSPECIFIED,"The checked turn strategies did not clear; this does not prove that every permitted maneuver is impossible.");m.obstruction_proven=!0}return"UNKNOWN"===m.verdict||!1===s.allowYaw&&/^FITS/.test(m.verdict||"")?(0,a.Sp)(m,m.unknown_reason,!1===s.allowYaw?"The turn check requires yaw; a turn without yaw has not been established.":m.message):m}(e,t,n);return s.accessPathMeasurements=[["width_mm","Incoming flight width"],["width_after_mm","Outgoing flight width"],["landing_w_mm","Landing width"],["landing_d_mm","Landing depth"],["height_mm","Landing headroom"],["turn_angle","Turn angle"]].filter(e=>{let[n]=e;return(null==t?void 0:t[n])!=null}).map(e=>{var n,a;let[o,r]=e;return{...(0,i.PG)(o,r,t[o],(0,i.KL)(t,o.replace("_mm",""),t[o]),"turn_angle"===o?"deg":"mm"),evaluationStatus:(null==(n=s.landingCheck)?void 0:n.effective_mm)?"partially_evaluated":"UNKNOWN"===s.verdict?"recorded_but_not_evaluated":"evaluated",constraintRef:null!=(a=s.check_scope)?a:"turn_strategy",note:s.landingCheck?"Local landing checkpoint only; adjoining-flight passage remains unproved.":"Declared turn strategy only."}}),s.accessPathMeasurements.push(...(0,i.Ep)(s)),s}},45715:(e,t,n)=>{n.d(t,{bu:()=>s,i_:()=>m,J5:()=>r.J5,$W:()=>d,rS:()=>c,QN:()=>h,n7:()=>l});var i=n(24861),a=n(35150),o=n(96744),r=n(84683);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{_urlOverride:t,headers:n,...r}=e,l=(0,o.Zg)(),s={...{"Content-Type":"application/json","X-Origin-Path":window.location.pathname||"","X-Origin-Referrer":function(e){let t;if("string"!=typeof e||0===e.length)return"";try{t=new URL(e)}catch(e){return""}return t.origin!==window.location.origin?"":t.pathname||""}(document.referrer),"X-Client-Turn-Id":i.i.currentTurnId()||"","X-Conversation-Id":(0,a.Hv)()||"","X-Chip-Lever":(0,o.H9)()||"","X-Chip-Category":(null==l?void 0:l.category)||"","X-Chip-Parent-Fit-Check":(null==l?void 0:l.parentFitCheckId)||"","X-Chip-Click-Id":(null==l?void 0:l.chipClickId)||""},...n||{}};return fetch(t||"/api/ai-chat",{...r,headers:s})}let s={name:"Standard Door",type:"Door",dimensions:{width:32,depth:6,height:80},isDefaulted:!0,dimensionSource:"IRC 2021 standard residential door"},m={name:"Room",type:"Room",dimensions:{width:144,depth:168,height:96},isDefaulted:!0,dimensionSource:"NAHB survey average bedroom"},c=/\b(room|bedroom|living\s*room|kitchen|garage|office|bathroom|basement|attic|nursery|den|studio)\b/i,d=new Set(["a","an","the","is","it","in","on","at","to","for","of","and","or","but","not","my","your","this","that","with","from","by","up","down","if","so","do","does","will","can","would","should","could","have","has","had","be","am","are","
1was","were","i","me","we","you","he","she","they","how","what","when","where","which","who","fit","fits","through","inside","into","door","room","box","car","trunk","couch","sofa","bed","table","chair","desk","stair","stairs","wall","window","measure","size","width","height","depth","inch","inches","feet","foot","standard","average","big","small","large","wide","tall","long","short"]),h={imperial:[{id:"in",label:"in"},{id:"ft",label:"ft"}],metric:[{id:"cm",label:"cm"},{id:"m",label:"m"},{id:"mm",label:"mm"}]}},46838:(e,t,n)=>{n.d(t,{d:()=>o});var i=n(84126),a=n(65964);function o(e){if(!(0,i.Y)(e))return null;let t=(0,a.Sf)(e);return"known"===t?"store_size":"estimated"===t?"store_estimate":"store_listed"}},48251:(e,t,n)=>{n.d(t,{Bh:()=>a,cC:()=>o});let i=Object.freeze([{key:"doorway",re:/\b(?:doorway|door\s*frame|entry(?:way)?|front\s+door|door)\b/i},{key:"hallway",re:/\b(?:hallway|hall|corridor)\b/i},{key:"stairs",re:/\b(?:stair(?:s|case|well|way)?|steps)\b/i},{key:"elevator",re:/\b(?:elevator|lift)\b/i},{key:"opening",re:/\b(?:opening|gap|aperture)\b/i},{key:"turn",re:/\b(?:turn|corner|pivot)\b/i}]);function a(e){try{let t=null==e?void 0:e.needs_user_input;if(!Array.isArray(t)||0===t.length)return[];return i.filter(e=>t.some(t=>"string"==typeof t&&e.re.test(t)))}catch(e){return[]}}function o(e,t){try{let n=null==e?void 0:e.assumptions;if(!Array.isArray(n)||0===n.length)return!1;return n.some(e=>{var n,i,a;let o="string"==typeof e?e:null!=(a=null!=(i=null!=(n=null==e?void 0:e.detail)?n:null==e?void 0:e.reason)?i:null==e?void 0:e.text)?a:"";return"string"==typeof o&&t.re.test(o)})}catch(e){return!1}}},49559:(e,t,n)=>{n.d(t,{A2:()=>N,GR:()=>h,Gg:()=>k,It:()=>f,J9:()=>d,JE:()=>m.JE,ND:()=>S,P8:()=>E,RF:()=>C,SM:()=>x,Xu:()=>I,Z4:()=>u,bM:()=>w,hf:()=>T,hw:()=>v,kX:()=>b,mk:()=>y,pO:()=>_,v:()=>D,vJ:()=>p,yE:()=>c});var i=n(95155),a=n(20908),o=n(48314),r=n(49074),l=n(77801),s=n(75159),m=n(26578);let c="[details-below]";function d(e){return"string"==typeof e&&e.includes(c)?e.split(c).join("\n\n").replace(/\n{3,}/g,"\n\n").trim():e}let h=3,u=[{label:"Sofa through a door",query:"Will my sofa fit through a 32 inch doorway?"},{label:"Bed in a 10\xd712 room",query:"Can I fit a queen bed and dresser in my 10\xd712 room?"},{label:"Suitcase in my car",query:"Will a large suitcase fit in my car trunk?"},{label:"Couch up the stairs",query:"Can I move my couch up a narrow staircase?"},{label:"Fridge through doorway",query:"Will my 36 inch fridge fit through the kitchen door?"}],_={why:(0,i.jsx)(a.A,{size:18,strokeWidth:2}),rotation:(0,i.jsx)(o.A,{size:18,strokeWidth:2}),maneuver:(0,i.jsx)(r.A,{size:18,strokeWidth:2}),difficulty:(0,i.jsx)(l.A,{size:18,strokeWidth:2}),assumptions:(0,i.jsx)(s.A,{size:18,strokeWidth:2})},g={green:"text-emerald-600",amber:"text-amber-600",red:"text-rose-600",gray:"text-slate-500"},p={color:"#334155",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",fontWeight:400,letterSpacing:"-0.01em",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},f={...p,color:"#0f172a",fontWeight:600,fontSize:"17px"},w=e=>{if(!e||"string"!=typeof e)return e;let t=e.trim();if(t.includes("\n\n"))return t;for(let e=t.length-2;e>15;e--)if(".!?".includes(t[e])&&" "===t[e+1]&&/[A-Z]/.test(t[e+2]||"")){let n=t.slice(0,e+1).trim(),i=t.slice(e+2).trim();if(n.length>=15&&i.length>=15)return"".concat(n,"\n\n").concat(i);break}return t},v=e=>{if(!e)return"";let t=e.trim(),n=t.split(/\n\n+/).filter(e=>{let t=e.trim();return!(/^Tap\s+[""\u201C\u201D]View[""\u201C\u201D]/i.test(t)||/^click below to view\s*$/i.test(t)||/^Let me (show|simulate|run)/i.test(t)&&t.length<100)});return n.length>0&&(n[n.length-1]=n[n.length-1].replace(/\s*Tap\s+[""\u201C\u201D]View[""\u201C\u201D][^.]*\.\s*$/i,"").replace(/\s*[-–—]\s*click below to view\s*$/i,"").replace(/\s*click below to view\s*$/i,"").trim()),t=n.filter(Boolean).join("\n\n")};function b(e){let t;if(!e)return{mainContent:"",sections:[]};let n=[],i=/\[([\w-]+)-details\]\n?>\s*(.+?)\n([\s\S]*?)\n?\[\/\1-details\]/g,a=0,o=[];for(;null!==(t=i.exec(e));)t.index>a&&o.push(e.slice(a,t.index)),a=t.index+t[0].length,n.push({id:t[1],title:t[2].trim().replace(/^\*\*|\*\*$/g,""),content:t[3].trim()});return a<e.length&&o.push(e.slice(a)),{mainContent:o.join("").trim(),sections:n}}function y(e,t){if(!e)return null;let n=(t||"").toUpperCase().replace(/[‘’ʼ']/g,"").replace(/_/g," ");
1if(n.includes("DOESNT FIT")||n.includes("DOES NOT FIT")||n.includes("WONT FIT")||n.includes("WILL NOT FIT")||n.includes("CANT FIT")||n.includes("CANNOT FIT")||n.includes("IMPOSSIBLE"))return g.red;switch(e){case"proven":case"high":return g.green;case"moderate":case"uncertain":return g.amber;default:return g.gray}}function T(e){var t,n;let i=(null==e||null==(t=e.recommended)?void 0:t.label)||"the recommended size",a=null==e||null==(n=e.alternative)?void 0:n.label;return["What if I have more big furniture than average?",a?"When would I need a ".concat(a," instead?"):"How much does the next size up hold?","What fits in ".concat(i,"?"),"Should I rent a truck, POD, or storage unit?"]}function I(e){var t,n;let i=(null==(t=e.classification)?void 0:t.scope)==="multi_identical"&&(null==(n=e.item)?void 0:n.name)||"items",a=e.recommendedCount||1;return["What if the room were larger?","How many different items fit instead?","What about stacking?","Will ".concat(a," ").concat(i," fit through the door?")]}let M={door:{space:"doorway",thisPhrase:"this doorway",dim:"width",dimAdj:"wide",thru:"through",axis:"width",roomLike:!1},hallway:{space:"hallway",thisPhrase:"this hallway",dim:"width",dimAdj:"wide",thru:"down",axis:"width",roomLike:!1},stairs:{space:"staircase",thisPhrase:"these stairs",dim:"width",dimAdj:"wide",thru:"up",axis:"width",roomLike:!1},turn:{space:"turn",thisPhrase:"this turn",dim:"space",dimAdj:"much room",thru:"around",axis:null,roomLike:!0},elevator:{space:"elevator",thisPhrase:"this elevator",dim:"depth",dimAdj:"deep",thru:"into",axis:"depth",roomLike:!1},vehicle:{space:"vehicle",thisPhrase:"this vehicle",dim:"space",dimAdj:"much room",thru:"into",axis:null,roomLike:!0},generic:{space:"space",thisPhrase:"this space",dim:"space",dimAdj:"much room",thru:"through",axis:null,roomLike:!0}};function S(e,t){var n,i,a,o,r,l,s,m,c;let{isFit:d}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=(null==e||null==(n=e.item)?void 0:n.name)||(null==t||null==(a=t.items)||null==(i=a[0])?void 0:i.name)||"",u=!!h,_=u?h:"item";if((null==e?void 0:e.queryType)==="turn_required_width")return["Will the ".concat(_," fit going straight (no turn)?"),"What about a tighter U-turn (180\xb0)?","What's the largest ".concat(_," that turns this corner?"),"Will a smaller ".concat(_," need less width?"),"How tight a corner can the ".concat(_," take?")];let g=M[function(e){let t=(e||"").toString().toLowerCase();return t?/\b(door|doorway|entry|entrance)s?\b/.test(t)?"door":/\b(hall|hallway|corridor|passage)s?\b/.test(t)?"hallway":/\b(stair|staircase|stairway|step)s?\b/.test(t)?"stairs":/\b(turn|corner|bend|landing)s?\b/.test(t)?"turn":/\b(elevator|lift)s?\b/.test(t)?"elevator":/\b(vehicle|car|truck|suv|van|trunk|sedan|hatchback|wagon|cargo)s?\b/.test(t)?"vehicle":"generic":"generic"}((null==t||null==(r=t.spaces)||null==(o=r[0])?void 0:o.name)||(null==e||null==(l=e.space)?void 0:l.type)||"")]||M.generic,p=null;
1if(g.axis){let e=Number(null==t||null==(c=t.spaces)||null==(m=c[0])||null==(s=m.dimensions)?void 0:s[g.axis]);Number.isFinite(e)&&e>0&&(p="".concat(Math.round(e),'"'))}let f=(d?[{text:"What's the largest ".concat(_," that fits ").concat(g.thisPhrase,"?"),needsItem:!1},...p?[{text:"What ".concat(_,"s fit ").concat(g.thru," a ").concat(p," ").concat(g.space,"?"),needsItem:!0}]:[],{text:"What's the minimum ".concat(g.space," ").concat(g.dim," for a ").concat(_,"?"),needsItem:!0},{text:"Will a bigger ".concat(_," still fit?"),needsItem:!0},{text:"What's the tightest ".concat(g.space," this ").concat(_," clears?"),needsItem:!1},{text:"Will it fit ".concat(g.thru," a narrower ").concat(g.space,"?"),needsItem:!1}]:[{text:"What size ".concat(g.space," does a ").concat(_," need?"),needsItem:!0},...p?[{text:"What ".concat(_,"s fit ").concat(g.thru," a ").concat(p," ").concat(g.space,"?"),needsItem:!0}]:[],{text:"What's the largest ".concat(_," that fits ").concat(g.thisPhrase,"?"),needsItem:!1},{text:"Will a smaller ".concat(_," fit?"),needsItem:!0},{text:g.roomLike?"How ".concat(g.dimAdj," must ").concat(g.thisPhrase," have for a ").concat(_,"?"):"How ".concat(g.dimAdj," must the ").concat(g.space," be for a ").concat(_,"?"),needsItem:!0}]).filter(e=>u||!e.needsItem).map(e=>e.text),w=["Will it fit ".concat(g.thru," a narrower ").concat(g.space,"?"),"What's the largest ".concat(_," that fits ").concat(g.thisPhrase,"?"),"What's the tightest ".concat(g.space," this ").concat(_," clears?")],v=[],b=new Set;for(let e of[...f,...w])if(b.has(e)||(b.add(e),v.push(e)),5===v.length)break;return v.slice(0,5)}function k(e){let t=(e||"").toString().trim();return t?t.replace(/^\d{4}(?:\s*[–-]\s*\d{2,4}|\+)?\s+/,"").trim()||t:"this vehicle"}function N(){let{item:e=null,vehicles:t=[],closestName:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(null==e?void 0:e.name)||"item",a=(null==e?void 0:e.dimsDisplay)?"".concat(e.dimsDisplay," ").concat(i):i,o=(Array.isArray(t)?t:[]).map(e=>k(null==e?void 0:e.displayName)).filter(Boolean),r="this vehicle"!==k(n)?k(n):o[0]||"this vehicle",l=[];for(let e of o)l.push("What else fits in a ".concat(e,"?"));l.push("What's the biggest box that fits in a ".concat(r,"?")),l.push("Will a ".concat(a," fit in a ").concat(r," with the rear seats folded down?")),l.push("Compare a ".concat(r," with another vehicle"));let s=["What's the smallest vehicle that fits a ".concat(i,"?"),"Will a ".concat(i," fit in a pickup truck bed?"),"How many ".concat(i,"s fit in a ").concat(r,"?")],m=[],c=new Set;for(let e of[...l,...s])if(e&&!c.has(e)&&(c.add(e),m.push(e)),5===m.length)break;return m}function x(e){if(!e)return{verdict:null,rest:""};let t=e.trim(),n={FITS:" ✓","FITS — WON'T CLOSE":" ✓","FITS — VERY TIGHT":" ⚠️","FITS IF TILTED":" ✓","TIGHT FIT":" ✓","PARTIALLY FITS":" ✓","DOESN'T FIT":" ✕","NEEDS MORE INFO":" ✕","INSUFFICIENT DATA":" ✕"};for(let{pattern:e,verdict:i}of[{pattern:/^(?:\*\*)?\s*FITS\s*[-–—]\s*WON[''\u2019]?T\s+CLOSE\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"FITS — WON'T CLOSE"},{pattern:/^(?:\*\*)?\s*FITS\s*[-–—]\s*VERY\s+TIGHT\s*(?:\*\*)?\s*[\u2713\u2715\u26A0\uFE0F]?\s*[-–—:]?\s*/i,verdict:"FITS — VERY TIGHT"},{pattern:/^(?:\*\*)?\s*FITS\s+IF\s+TILTED\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"FITS IF TILTED"},{pattern:/^(?:\*\*)?\s*PARTIALLY\s+FITS\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"PARTIALLY FITS"},{pattern:/^(?:\*\*)?\s*NEEDS\s+MORE\s+INFO\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"NEEDS MORE INFO"},{pattern:/^(?:\*\*)?\s*TIGHT\s+FIT\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"TIGHT FIT"},{pattern:/^(?:\*\*)?\s*(?:DOESN|DOES\s*N)[''\u2019]?T\s+FIT\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"DOESN'T FIT"},{pattern:/^(?:\*\*)?\s*INSUFFICIENT\s+DATA\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"INSUFFICIENT DATA"},{pattern:/^(?:\*\*)?\s*FITS\s*(?:\*\*)?\s*[\u2713\u2715]?\s*[-–—:]?\s*/i,verdict:"FITS"}]){let a=t.match(e);if(a){let e=n[i]||"";return{verdict:i+e,rest:t.slice(a[0].length)}}}let i=t.match(/^\*\*([^*]+)\*\*\s*[\u2713\u2715]?\s*[-–—:]?\s*/);if(i)return{verdict:i[1].trim(),rest:t.slice(i[0].length)};let a=t.slice(0,100);for(let{pattern:e,verdict:n}of[{pattern:/\*\*(FITS\s*[-–—]\s*WON[''\u2019]?T\s+CLOSE)\*\*/i,verdict:"FITS — WON'T CLOSE"},{pattern:/\*\*(FITS\s*[-–—]\s*VERY\s+TIGHT)\*\*/i,verdict:"FITS — VERY TIGHT"},{pattern:/\*\*(FITS\s+IF\s+TILTED)\*\*/i,verdict:"FITS IF TILTED"},{pattern:/\*\*(PARTIALLY\s+FITS)\*\*/i,verdict:"PARTIALLY FITS"},{pattern:/\*\*(NEEDS\s+MORE\s+INFO)\*\*/i,verdict:"NEEDS MORE INFO"},{pattern:/\*\*(TIGHT\s+FIT)\*\*/i,verdict:"TIGHT FIT"},{pattern:/\*\*(DOESN[''\u2019]?T\s+FIT)\*\*/i,verdict:"DOESN'T FIT"},{pattern:/\*\*(FITS)\*\*/i,verdict:"FITS"}])if(a.match(e))return{verdict:n,rest:t.replace(e,"").trim().replace(/^[-–—:]\s*/,"")};let o=/\*\*([^*]+)\*\*/,r=a.match(o);if(r){let e=t.replace(o,"").trim().replace(/^[-–—:]\s*/,"");return{verdict:r[1].trim(),rest:e}}return{verdict:null,rest:e}}function E(e){let t=v(e.content),n=/\[source(?::[^\]]+)?\]/.test(t),{verdict:i,rest:a}=x(t),o=i?a:t;return!n&&o.includes(c)?o.split(c)[1].trim():null}let D=e=>{if(!(null==e?void 0:e.content))return!1;let t=e.content.slice(0,120);return/(?:\*\*)?\s*NEEDS?\b[^\n]{0,20}?\bMORE\s+INFO/i.test(t)||/(?:\*\*)?\s*INSUFFICIENT\s+DATA/i.test(t)},F=/^(?:CLARIFY|UNKNOWN|INCOMPLETE|NEEDS_MORE_INFO|INSUFFICIENT_CERTAINTY|NO_SOLVER_MATCH)$/i,C=e=>{var t,n,i;if(!e||"assistant"!==e.role)return!1;if(null==(t=e.schematicData)?void 0:t.comparison)return!0;
1if(!(null==(n=e.solverMetadata)?void 0:n.verdict))return!1;let a=null==(i=e.solverMetadata)?void 0:i.queryType;return!(!e.schematicData&&"inventory-fit"!==a&&"inventory_fit"!==a||D(e))&&"catalog-fit"!==a&&"catalog_fit_recommendation"!==a&&!F.test(String(e.solverMetadata.verdict).trim())}},49931:(e,t,n)=>{n.d(t,{Cq:()=>p,Nb:()=>b,lk:()=>y});var i=n(87062),a=n(95704);let o="margin/v1",r=Object.freeze(["mm","mm2","mm3","kg","count","ratio","none"]),l=Object.freeze(["linear_clearance","binding_axis_clearance","path_minimum_clearance","total_walkway_remaining","area_remaining","volume_remaining","fill_ratio_remaining","count_remaining","load_capacity_remaining","required_dimension_delta","unavailable"]),s=Object.freeze(["MARGIN_NOT_COMPUTED","MARGIN_MISSING_REQUIRED_INPUT","MARGIN_NOT_APPLICABLE","MARGIN_UNSUPPORTED_BASIS","MARGIN_NON_FINITE_RESULT","MARGIN_LEGACY_SENTINEL","MARGIN_AMBIGUOUS_CONSTRAINT","MARGIN_SEARCH_INCOMPLETE","MARGIN_SOLVER_ERROR","MARGIN_LEGACY_UNVERSIONED"]),m=Object.freeze(["comfortable","tight","boundary","tolerance_shortfall","over_capacity","unknown"]),c=Object.freeze({linear_clearance:"mm",binding_axis_clearance:"mm",path_minimum_clearance:"mm",total_walkway_remaining:"mm",area_remaining:"mm2",volume_remaining:"mm3",fill_ratio_remaining:"ratio",count_remaining:"count",load_capacity_remaining:"kg",required_dimension_delta:"mm",unavailable:"none"}),d=new Set(["TIMEOUT","UNSUPPORTED","SEARCH_INCOMPLETE","ERROR",...i.sY]),h=new Set(["DOESN'T_FIT","DOES_NOT_FIT","FAIL","NO_FIT","TOO_LARGE"]);function u(e){let t=String(null!=e?e:"").toUpperCase();return"no_fit"===(0,i.fF)(t)||h.has(t)}let _=new Set([-999]),g=Object.freeze([{match:/inventory/,basis:"volume_remaining"},{match:/load[_-]?capacity|floor[_-]?load/,basis:"load_capacity_remaining"},{match:/capacity|residual.*count|move[_-]?size/,basis:"count_remaining"},{match:/maneuver|motion|rrt|corner/,basis:"path_minimum_clearance"},{match:/room[_-]?multi|multi[_-]?room/,basis:"unavailable"},{match:/room/,basis:"total_walkway_remaining"},{match:/comparison|optimization|arrangement/,basis:"unavailable"},{match:/opening|slot|elevator|hallway|turn|stair|winder|spiral|tightest|cross|container|vehicle|hybrid|passage/,basis:"binding_axis_clearance"}]);function p(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.env,n=String(null!=(e=null==t?void 0:t.CANONICAL_MARGIN_V1)?e:"off").toLowerCase();return["shadow","limited_live","live"].includes(n)?n:"off"}function f(e){return{margin_schema_version:o,margin_value:null,margin_unit:"none",margin_basis:"unavailable",margin_unknown_reason:e,margin_band:"unknown",margin_policy_version:null}}let w=new Set(["linear_clearance","binding_axis_clearance","path_minimum_clearance"]);function v(e){let{verdict:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];e&&e.margin_schema_version===o||n.push("MARGIN_SCHEMA_INVALID"),r.includes(null==e?void 0:e.margin_unit)||n.push("MARGIN_UNIT_INVALID"),l.includes(null==e?void 0:e.margin_basis)||n.push("MARGIN_BASIS_INVALID"),m.includes(null==e?void 0:e.margin_band)||n.push("MARGIN_BAND_INVALID"),c[null==e?void 0:e.margin_basis]!==(null==e?void 0:e.margin_unit)&&n.push("MARGIN_UNIT_BASIS_MISMATCH"),(null==e?void 0:e.margin_band)!=="boundary"||(null==e?void 0:e.margin_value)===0||(null==e?void 0:e.margin_policy_version)||n.push("MARGIN_BAND_INVALID"),(null==e?void 0:e.margin_value)===null||Number.isFinite(null==e?void 0:e.margin_value)||n.push("MARGIN_VALUE_NON_FINITE"),_.has(null==e?void 0:e.margin_value)&&n.push("MARGIN_SENTINEL_LEAK"),(null==e?void 0:e.margin_value)===null?(((null==e?void 0:e.margin_basis)!=="unavailable"||(null==e?void 0:e.margin_unit)!=="none"||(null==e?void 0:e.margin_band)!=="unknown")&&n.push("MARGIN_NULL_DISCRIMINANT_INVALID"),s.includes(null==e?void 0:e.margin_unknown_reason)||n.push("MARGIN_UNKNOWN_REASON_INVALID")):(null==e?void 0:e.margin_unknown_reason)!==null&&n.push("MARGIN_VALUE_WITH_UNKNOWN_REASON");let i=String(null!=t?t:"").toUpperCase();return(null==e?void 0:e.margin_value)!==null&&d.has(i)&&n.push("MARGIN_NON_ANSWER_HAS_VALUE"),(null==e?void 0:e.margin_value)!==null&&(null==e?void 0:e.margin_value)>=0&&u(i)&&n.push("MARGIN_SIGN_VERDICT_CONTRADICTION"),(null==e?void 0:e.margin_value)!==null&&(null==e?void 0:e.margin_value)<0&&!u(i)&&(null==e?void 0:e.margin_band)!=="tolerance_shortfall"&&n.push("MARGIN_SIGN_VERDICT_CONTRADICTION"),Object.freeze([...new Set(n)])}function b(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"object"!=typeof e)return e;let i=function(e){var t,n,i,a,r,m;let{solverFamily:h,basis:p,unit:b,unknownReason:y}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"object"!=typeof e)return f("MARGIN_NOT_COMPUTED");let T=null!=(n=null!=(t=e.margin_value)?t:e.margin_mm)?n:null,I=null!=p?p:function(e,t){var n,i,a,o,r;let s=null!=(i=null==e?void 0:e.margin_basis)?i:null==e?void 0:e.marginBasis;if(l.includes(s))return s;if("floor_area"===s)return"area_remaining";let m=String(null!=(o=null!=(a=null!=t?t:null==e?void 0:e.solver_family)?a:null==e?void 0:e.method)?o:"").toLowerCase();return null!=(r=null==(n=g.find(e=>{let{match:t}=e;return t.test(m)}))?void 0:n.basis)?r:"unavailable"}(e,h);if(null==T||_.has(T)||!Number.isFinite(T)){let t=s.includes(e.margin_unknown_reason)?e.margin_unknown_reason:null;return f(null!=(i=null!=y?y:t)?i:_.has(T)?"MARGIN_LEGACY_SENTINEL":"number"!=typeof T||Number.isFinite(T)?(null==e?void 0:e.search_incomplete)||(null==e?void 0:e.termination)==="search_incomplete"?"MARGIN_SEARCH_INCOMPLETE":(null==e?void 0:e.error)?"MARGIN_SOLVER_ERROR":d.has(String(null!=(m=null==e?void 0:e.verdict)?m:"").toUpperCase())?"MARGIN_NOT_APPLICABLE":null==T?"MARGIN_NOT_COMPUTED":"MARGIN_AMBIGUOUS_CONSTRAINT":"MARGIN_NON_FINITE_RESULT")}if(d.has(String(null!=(a=e.verdict)?a:"").toUpperCase()))return f(null!=y?y:"MARGIN_NOT_APPLICABLE");if("unavailable"===I)return f(null!=y?y:"MARGIN_UNSUPPORTED_BASIS");let M=function(e,t,n){if(!w.has(n)||!(e<0)||(null==t?void 0:t.margin_policy_version)||!u(null==t?void 0:t.verdict))return null;let i=null==t?void 0:t.raw_margin_mm,a=null==t?void 0:t.effective_margin_mm,o=null==t?void 0:t.handling_buffer_mm;return![i,a,o].every(Number.isFinite)||o<=0||Math.abs(a-e)>1||Math.abs(i-(a+o))>1||i<0?null:0===i?"boundary":"tolerance_shortfall"}(T,e,I),S={margin_schema_version:o,margin_value:T,margin_unit:null!=b?b:c[I],margin_basis:I,margin_unknown_reason:null,margin_band:null!=M?M:0===T?"boundary":T<0?(null==e?void 0:e.margin_policy_version)&&!u(null==e?void 0:e.verdict)?"tolerance_shortfall":"over_capacity":(null==e?void 0:e.margin_band)==="comfortable"&&(null==e?void 0:e.margin_policy_version)?"comfortable":"tight",margin_policy_version:null!=(r=e.margin_policy_version)?r:M?"linear-handling-buffer/1":null},k=v(S,{verdict:e.verdict});return 0===k.length?S:{...f("MARGIN_AMBIGUOUS_CONSTRAINT"),validation_codes:k}}(e,n);return{...e,...!i?{}:Object.fromEntries(["margin_schema_version","margin_value","margin_unit","margin_basis","margin_unknown_reason","margin_band","margin_policy_version"].map(e=>{var t;return[e,null!=(t=i[e])?t:null]})),canonical_margin:i,margin_validation_codes:null!=(t=i.validation_codes)?t:v(i,{verdict:e.verdict})}}function y(e){return!Number.isFinite(e)||_.has(e)?null:{mm:e,role:"clearance",source:"solver"}}},50573:(e,t,n)=>{n.d(t,{solveOptimization:()=>r});var i=n(22110),a=n(5979);
1let o=[{key:"space_efficient",label:"Space-efficient",sortFn:e=>[...e].sort((e,t)=>{let n=e.width_mm*e.depth_mm;return t.width_mm*t.depth_mm-n||(e.name||"").localeCompare(t.name||"")}),tradeoffDesc:"Tightest pack — items placed largest-first for maximum floor coverage"},{key:"accessible",label:"Easy access",sortFn:e=>[...e].sort((e,t)=>e.width_mm*e.depth_mm-t.width_mm*t.depth_mm||(e.name||"").localeCompare(t.name||"")),tradeoffDesc:"Smaller items placed first — larger items remain accessible near the entrance"},{key:"grouped",label:"Grouped by type",sortFn:e=>[...e].sort((e,t)=>{let n=(e.name||"").toLowerCase(),i=(t.name||"").toLowerCase();if(n!==i)return n.localeCompare(i);let a=e.width_mm*e.depth_mm;return t.width_mm*t.depth_mm-a}),tradeoffDesc:"Same-type items placed together — organized but may leave gaps"},{key:"balanced",label:"Balanced",sortFn:e=>{let t=[...e].sort((e,t)=>{let n=e.width_mm*e.depth_mm;return t.width_mm*t.depth_mm-n||(e.name||"").localeCompare(t.name||"")}),n=[],i=0,a=t.length-1,o=!0;for(;i<=a;)n.push(o?t[i++]:t[a--]),o=!o;return n},tradeoffDesc:"Large and small items interleaved — moderate density with reasonable access"}];function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{allowedOrientations:r=null,obstacles:s=[]}=n;if(!e||e.length<=1)return{redirect:"arrangement",strategies:[]};let m=[];for(let n of o){let a=n.sortFn(e),o=(0,i.solveArrangement)(a,t,{allowedOrientations:r,obstacles:s,preserveOrder:!0});if(o.feasible){let e=l(o,t);m.push({label:n.label,placements:o.placements,scores:e,feasible:!0,utilization:o.utilization,walkingPath:o.walkingPath,loadingOrder:a.map(e=>e.name||"item"),tradeoff:n.tradeoffDesc,warnings:o.warnings})}}let c=(0,i.f)(e,t,{trials:50,timeBudget_ms:150,allowedOrientations:r});if(c.feasible){let e=l(c,t),n=m.reduce((e,t)=>Math.max(e,t.utilization),0);c.utilization>=n&&m.push({label:"Optimized",placements:c.placements,scores:e,feasible:!0,utilization:c.utilization,walkingPath:c.walkingPath,loadingOrder:c.placements.map(e=>e.item),tradeoff:"Randomized search found the best packing — may differ from intuitive orderings",warnings:c.warnings})}let d=function(e){let t=new Set,n=[];for(let i of e){let e=i.placements.map(e=>"".concat(e.item,":").concat(e.position.x,",").concat(e.position.y)).join("|");t.has(e)||(t.add(e),n.push(i))}return n}(m);if(0===d.length)return{strategies:[],noFeasibleStrategy:!0,warnings:(0,i.solveArrangement)(e,t,{allowedOrientations:r,obstacles:s}
1).warnings||["Items do not fit in the available space"],recommendation:{text:"No valid arrangement found."},space:t};let h=function(e){if(1===e.length)return{text:"The space is tight enough that reordering doesn't help."};let t=e[0],n=e[0];for(let i of e)i.scores.spaceEfficiency>t.scores.spaceEfficiency&&(t=i),i.scores.accessibility>n.scores.accessibility&&(n=i);let i=e.find(t=>e.every(e=>t===e||t.scores.spaceEfficiency>=e.scores.spaceEfficiency&&t.scores.accessibility>=e.scores.accessibility));if(i)return{text:"".concat(i.label," is the clear best option — better on all dimensions.")};let a=[];return t!==n?(a.push("If packing tight matters, ".concat(t.label," (").concat(Math.round(100*t.scores.spaceEfficiency),"% usage).")),a.push("If you need easy access to items, ".concat(n.label," (").concat(Math.round(100*n.scores.accessibility),"% accessibility)."))):a.push("".concat(t.label," scores highest overall.")),{text:a.join(" ")}}(d);return(0,a.H)("optimization",{strategies:d,recommendation:h,queryType:"optimization",space:t})}function l(e,t){let{placements:n,utilization:i,walkingPath:a}=e;t.width_mm,t.depth_mm;let o=Math.min(1,Math.max(0,i)),r=t.depth_mm,l=0;for(let e of n)l+=1-e.position.y/r;return{spaceEfficiency:Math.round(100*o)/100,accessibility:Math.round(100*(n.length>0?Math.min(1,Math.max(0,l/n.length)):0))/100,stability:Math.round(100)/100,loadingEase:Math.round(100*function(e){if(e.length<=1)return 1;let t=0,n=e.length*(e.length-1)/2;for(let n=0;n<e.length;n++)for(let i=n+1;i<e.length;i++)e[n].orientation.w*e[n].orientation.d<e[i].orientation.w*e[i].orientation.d&&t++;return n>0?Math.max(0,1-t/n):1}(n))/100}}},53557:(e,t,n)=>{n.d(t,{a:()=>a});let i="true"===n(95704).env.NEXT_PUBLIC_CHAT_DIAG;function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i&&console.log(...t)}},54059:(e,t,n)=>{n.d(t,{ZX:()=>c,Zt:()=>l,ok:()=>d,s7:()=>u});let i=Object.freeze(["published","measured","researched","approximate","estimated"]),a=Object.freeze(new Set(["approximate","estimated"])),o=Object.freeze(["space_length_mm","space_width_mm","space_height_mm","opening_width_mm","opening_height_mm"]),r=Object.freeze({space_length_mm:"cargo length",space_width_mm:"cargo width",space_height_mm:"cargo height",opening_width_mm:"opening width",opening_height_mm:"opening height"}),l=Object.freeze({published:"Published",measured:"Measured",researched:"Researched",approximate:"Approximate",estimated:"Estimated"}),s=["opening_width_mm","opening_height_mm"],m=["space_length_mm","space_width_mm","space_height_mm"];function c(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let t={};for(let n of o){let a=e[n];a&&"object"==typeof a&&i.includes(a.status)&&(t[n]={status:a.status,basis:"string"==typeof a.basis?a.basis:null})}return Object.keys(t).length?t:null}function d(e){return a.has(e)}function h(e){let t=[...new Set(e.map(e=>r[e]))];return t.length<=1?t.join(""):"".concat(t.slice(0,-1).join(", ")," and ").concat(t[t.length-1])}function u(e,t,n){let i=(null==t?void 0:t.dimensionProvenance)||null,a=i?o.filter(e=>i[e]&&d(i[e].status)):[];if(!a.length)return{notes:[],decisiveUncertain:!1};let l=(function(e,t){var n;if(!e)return[];if(e.blocked||(null==(n=e.accessConstraint)?void 0:n.isBottleneck))return s;let i=e.orientation,a=null==t?void 0:t.space;if(!i||!a||null==i.l||null==i.w||null==i.h)return m;let o=[["space_length_mm",a.length_mm-i.l],["space_width_mm",a.width_mm-i.w],["space_height_mm",a.height_mm-i.h]].filter(e=>{let[,t]=e;return Number.isFinite(t)});if(!o.length)return m;let r=Math.min(...o.map(e=>{let[,t]=e;return t}));return o.filter(e=>{let[,t]=e;return t===r}).map(e=>{let[t]=e;return t})})(e,t).filter(e=>a.includes(e));if(l.length){let e=new Set(l.map(e=>i[e].status)),t=e.size>1?"estimated or approximate":[...e][0],n=new Set(l.map(e=>r[e])).size>1?"are":"is";return{notes:["This result depends on the ".concat(h(l),", which ").concat(n," ").concat(t," for this vehicle — measure yours before relying on it.")],decisiveUncertain:!0,decisive:{fields:l,status:e.size>1?"mixed":[...e][0]}}}return Number.isFinite(n)&&51>
1=Math.abs(n)?{notes:["Some dimensions for this vehicle are estimated (".concat(h(a),"). With a margin this small, measure yours to confirm.")],decisiveUncertain:!1}:{notes:[],decisiveUncertain:!1}}},54269:(e,t,n)=>{n.d(t,{Bw:()=>M,Ke:()=>c,gX:()=>u,kD:()=>S});var i=n(58271),a=n(84511),o=n(29157),r=n(31587),l=n(3732);[...r.X];let s=[/how\s+many\s+\w+.*\b(?:fit|go|hold|pack|store)\b/i,/how\s+many\s+\w+.*\b(?:in|into|inside)\b/i,/how\s+much\s+\w+.*\b(?:fit|go|pack|store)\b/i,/how\s+many\s+.*\b(?:can|will|would|could)\s+(?:i\s+)?(?:fit|put|store|pack)\b/i,/how\s+many\s+.*\b(?:will|can|could|would)\s+.*\b(?:hold|contain|accommodate)\b/i,/\b(?:maximum|max)\s+(?:number|amount|quantity)\s+of\s+\w+.*\b(?:fit|go)\b/i],m=[/\b(?:weight|load)\s+(?:limit|capacity|rating|max(?:imum)?)\b/i,/\b(?:too\s+)?heavy\s+(?:for|to\s+(?:carry|lift|move))\b/i,/\b(?:max(?:imum)?|how\s+much)\s+weight\b/i,/\bcan\s+(?:the|an?|my)\s+\w+\s+(?:hold|support|take)\s+\d+\s*(?:lb|kg|pound|kilo)/i];function c(e){return"string"==typeof e&&m.some(t=>t.test(e))}let d=[/what\s+(?:size|kind|type)\s+(?:of\s+)?(?:truck|van|vehicle|storage|container)/i,/how\s+big\s+(?:of\s+)?(?:a\s+)?(?:truck|van|vehicle|storage|container)/i,/what\s+(?:truck|van|vehicle|storage)\s+(?:do|would|will)\s+i\s+need/i,/need\s+a\s+(?:truck|van)\s+(?:for|to\s+fit|to\s+move)/i],h=[/\b(?:what(?:\s+size)?|which|how\s+big(?:\s+of)?(?:\s+a)?)\b[^?]*\b(?:moving\
1s+truck|truck|pod|storage(?:\s+unit)?|cargo\s+van|van|unit|container)\b[^?]*\b(?:\d+[\s-]*bed(?:room)?s?|studio|apartment|house|home|condo|dorm|whole\s+(?:apartment|house|home|place|move))\b/i,/\b(?:\d+[\s-]*bed(?:room)?s?|studio|apartment|house|home|condo|dorm|whole\s+(?:apartment|house|home|place|move))\b[^?]*\b(?:moving\s+truck|truck|pod|storage(?:\s+unit)?|cargo\s+van|van|unit)\b/i,/\bmov(?:e|ing)\s+(?:a|an|my|out\s+of\s+(?:a|an|my)?\s*)?(?:\d+[\s-]*bed(?:room)?s?|studio|apartment|house|home|condo|dorm)\b/i,/\bhow\s+big\b[^?]*\b(?:truck|pod|van|storage|unit)\b[^?]*\b(?:whole|entire)\b/i];function u(e){return"string"==typeof e&&h.some(t=>t.test(e))}let _=[["truck",/\b(?:moving\s+truck|box\s+truck|cargo\s+van|u-?haul|penske|budget\s+truck|truck|van)\b/i],["pod",/\b(?:pods?|portable\s+(?:storage\s+)?container|portable\s+storage)\b/i],["storage",/\b(?:storage\s+unit|self[-\s]?storage|storage\s+space|storage\s+locker|storage)\b/i]],g=[/(\d+\s*(?:ft|foot|'))\s+(?:or|vs\.?|versus)\s+(\d+\s*(?:ft|foot|'))/i,/(?:which|what)\s+(?:is|would\s+be)\s+(?:better|best|easier)/i,/should\s+i\s+(?:use|go|take|try)\s+.+\s+(?:or|vs)\s+/i,/(.+)\s+(?:or|vs\.?|versus)\s+(.+)\s+(?:for|to\s+fit)/i,/\bcompare\s+/i,/(front|back|side|garage)\s+door\s+(?:or|vs)\s+(front|back|side|garage)\s+door/i,/(.+)\s+instead\s+of\s+(.+)/i],p=[/best\s+(?:way|method|approach)\s+to\s+(?:fit|pack|load|arrange)\b/i,/most\s+efficient\s+(?:way|packing|arrangement|loading)\b/i,/how\s+should\s+i\s+(?:pack|load|arrange|organize)\b/i,/\boptimal\s+(?:layout|arrangement|packing|loading)\b/i,/\bmaximize\s+(?:space|room|capacity)\b/i,/\bminimize\s+(?:wasted\s+space|gaps)\b/i,/\bloading\s+(?:order|sequence|strategy)\b/i],f=[/how\s+(?:would|could|should|do|can)\s+.+\s+fit\b/i,/where\s+(?:would|should|do|can)\s+.+\s+(?:go|fit|be\s+placed)\b/i,/best\s+(?:way|place|spot)\s+to\s+(?:put|place|position)\b/i,/\barrange\s+.+\s+in\b/i,/\blayout\s+(?:for|of|with)\b/i,/\bset\s+up\s+.+\s+in\b/i],w=[/\bwill\s+.*\bfit\b/i,/\bdoes\s+.*\bfit\b/i,/\bcan\s+.*\bfit\b/i,/\bfit\s+(?:a|an|the|my|this|that)\b/i],v=new Set(["doorway","opening","hallway","stairs","turn","entry","entrance","passage"]),b=new Set(["room","container","vehicle","elevator"]),y=/\b(?:through|door(?:way)?|hallway|hall|corridor|passage|stair(?:s|way|case)?|opening|entry|entrance)\b/i,T=/\b(?:room|bedroom|living\s*room|office|garage|space|box|bin|trunk|suitcase|briefcase|crate|c
1ontainer|bag|drawer|closet|van|truck|shed|storage|attic|basement)\b/i,I=/\b(?:through\b.*\b(?:in(?:to)?|inside)\b|\b(?:in(?:to)?|inside)\b.*\bthrough\b)/i;function M(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=S(e,t);return{intent:n,scope:function(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(/\bhow\s+many\s+\w+/i.test(e||""))return"multi_identical";let a=(null==(t=i.items)?void 0:t.length)||0;if(a>1)return 1===new Set(i.items.map(e=>(e.name||"").toLowerCase())).size?"multi_identical":"multi_mixed";if(1===a||i.item){let t=(0,o.OL)(e||"",a||1);return t.isMultiItem&&("quantity-parser"!==t.source||!((null==(n=t.items)?void 0:n.length)>0)||t.items.some(e=>e.name&&!/^(?:room|door|hallway|ft|in|cm|mm|m|x\d)$/i.test(e.name.trim())))?t.items&&t.items.length>1?1===new Set(t.items.map(e=>e.name.toLowerCase())).size?"multi_identical":"multi_mixed":"multi_identical":"single"}let r=(0,o.OL)(e||"",0);return r.isMultiItem?r.items&&r.items.length>0?1===new Set(r.items.map(e=>e.name.toLowerCase())).size?"multi_identical":"multi_mixed":"multi_identical":"single"}(e,t),constraint:function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null==(t=n.space)?void 0:t.type;if(e&&I.test(e))return"hybrid";if(i){if(v.has(i))return"path";if(b.has(i))return"container"}if(e){let t=y.test(e),n=T.test(e);if(t&&n)return"hybrid";if(t)return"path"}return"container"}(e,t),model:function(e){var t,n;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(null==(t=a.items)?void 0:t.length)?a.items:a.item?[a.item]:[],s="rigid";o.length&&"approximate_soft"===(0,r.O8)(o)?s="approximate_soft":(0,r.mC)(e)&&(s="approximate_soft");try{if("approximate_soft"===s&&"rigid"===function(e,t){var n,i,a;let o=(null==(n=t.item)?void 0:n.name)||(null==(a=t.items)||null==(i=a[0])?void 0:i.name)||"";if(o){let e=(0,l.bD)(o,"theoretical");if(e&&N.includes(e.category))return"approximate_soft"}return e&&k.test(e)?"approximate_soft":"rigid"}(e,a)){let e=o.map(e=>null==e?void 0:e.name).filter(Boolean).slice(0,5),t=o.length>1&&"approximate_soft"!==(0,r.NL)(null==(n=o[0])?void 0:n.name);i.U.log("[SOFT-DRIFT-FIX]",JSON.stringify({dimension:t?"multi_item_non_first":"new_vocab",itemCount:o.length,items:e}))}}catch(e){}return s}(e,t),spaceFamily:"move_size"===n?function(e){if("string"!=typeof e)return null;for(let[t,n]of _)if(n.test(e))return t;return null}(e):null}}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"fit";if(m.some(t=>t.test(e)))return"load_capacity";let n=null==t?void 0:t.moveProfile;if(n&&(null!=n.bedrooms||Array.isArray(n.rooms)&&n.rooms.length>0||"string"==typeof n.dwelling&&n.dwelling.length>0)||h.some(t=>t.test(e)))return"move_size";if(d.some(t=>t.test(e)))return"dimension";if(!/\bhow\s+many\b/i.test(e)&&p.some(t=>t.test(e)))return"optimization";if(!/\bhow\s+many\b/i.test(e)&&g.some(t=>t.test(e)))return"comparison";if(!/\bhow\s+many\b/i.test(e)&&f.some(t=>t.test(e))&&!w.some(t=>t.test(e)))return"arrangement";if(s.some(t=>t.test(e))){let t=(0,a.bz)(e);return(t.length>0&&t.some(e=>e.qty>0),!/\b(?:fit|put|place|store|pack)\s+\d+\b/i.test(e)||/\bhow\s+many\b/i.test(e)||/\bhow\s+much\s+(?:space|room|area)\b/i.test(e))?"capacity":"fit"}return w.some(t=>t.test(e)),"fit"}let k=/\b(?:shirts?|pants|jeans|jackets?|coats?|sweaters?|hoodies?|socks?|underwear|t-?shirts?|blouses?|dress(?:es)?|skirts?|scarves?|scarfs?|gloves?|hats?|beanies?|pillows?|cushions?|blankets?|towels?|linens?|duvets?|comforters?|quilts?|sleeping\s*bags?|stuffed\s*animals?|plush(?:ies)?|cloth(?:es|ing)?)\b/i,N=["clothing","pillow","blanket","towel","linen","bag","cushion"]},55786:(e,t,n)=>{n.d(t,{R_:()=>j,Pe:()=>z});var i=n(58271),a=n(70593),o=n(98524);let r=180/Math.PI,l=2*Math.PI,s={maxIterations:5e3,stepSize_mm:50,stepSize_rad:Math.PI/180*5,goalBias:.1,smoothingPasses:50,collisionSteps:8,wallThickness_mm:200};function m(e,t){let n=1/0,i=-1/0;for(let a of e){let e=a[0]*t[0]+a[1]*t[1];e<n&&(n=e),e>i&&(i=e)}return[n,i]}function c(e){return(e%=l)>Math.PI&&(e-=l),e<-Math.PI&&(e+=l),e}function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=e[0]-t[0],a=e[1]-t[1];return Math.sqrt(i*i+a*a+(c(e[2]-t[2])*n)**2)}function h(e,t,n,i){let a=function(e,t,n,i,a){let o=Math.cos(n),r=Math.sin(n);return[[e+i*o-a*r,t+i*r+a*o],[e-i*o-a*r,t-i*r+a*o],[e-i*o+a*r,t-i*r-a*o],[e+i*o+a*r,t+i*r-a*o]]}(e[0],e[1],e[2],t,n);for(let e of i)if(function(e,t){for(let n of[e,t])for(let i=0;i<n.length;
1i++){let a=(i+1)%n.length,o=n[a][0]-n[i][0],r=n[a][1]-n[i][1],l=Math.sqrt(o*o+r*r);if(0===l)continue;let s=[-r/l,o/l],[c,d]=m(e,s),[h,u]=m(t,s);if(d<h||u<c)return!1}return!0}(a,e))return!1;return!0}function u(e,t,n,i,a,o){for(let r=0;r<=o;r++){let l=r/o;if(!h([e[0]+(t[0]-e[0])*l,e[1]+(t[1]-e[1])*l,e[2]+c(t[2]-e[2])*l],n,i,a))return!1}return!0}function _(e){var t;let{item:n,space:i,constraints:a,options:o={}}=e,r={...s,...o},l=null!=(t=null==a?void 0:a.collisionBuffer_mm)?t:r.collisionBuffer_mm,m=n.width_mm/2+l,_=n.length_mm/2+l,g=function(e){let t=[],n=s.wallThickness_mm;switch(e.type){case"opening":{let n=e.width_mm/2,i=(e.depth_mm||150)/2;t.push([[-5e3,-i],[-n,-i],[-n,i],[-5e3,i]]),t.push([[n,-i],[5e3,-i],[5e3,i],[n,i]]);break}case"hallway":{let i=e.hallway_width_mm;t.push([[-n,-5e3],[0,-5e3],[0,5e3],[-n,5e3]]),t.push([[i,-5e3],[i+n,-5e3],[i+n,5e3],[i,5e3]]);break}case"turn":{let i=e.corridor_width_1_mm,a=e.corridor_width_2_mm||i;t.push([[-n,-5e3],[0,-5e3],[0,0],[-n,0]]),t.push([[i,-5e3],[i+n,-5e3],[i+n,a+n],[i,a+n]]),t.push([[0,a],[5e3,a],[5e3,a+n],[0,a+n]]),t.push([[i,-n],[5e3,-n],[5e3,0],[i,0]]),t.push([[-5e3,0],[0,0],[0,5e3],[-5e3,5e3]])}}return t}(i),{start:p,goal:f,goalRadius_mm:w,goalRadius_rad:v}=function(e,t){let n=t+500;switch(e.type){case"opening":default:return{start:[0,-n,0],goal:[0,n,0],goalRadius_mm:t,goalRadius_rad:Math.PI/4};case"hallway":{let i=e.hallway_width_mm/2;return{start:[i,-n,0],goal:[i,n,0],goalRadius_mm:t,goalRadius_rad:Math.PI/4}}case"turn":{let i=e.corridor_width_1_mm,a=e.corridor_width_2_mm||i;return{start:[i/2,-n,0],goal:[n,a/2,Math.PI/2],goalRadius_mm:t,goalRadius_rad:Math.PI/4}}}}(i,n.length_mm),b=function(e,t){let n=t+1e3;switch(e.type){case"opening":return{xMin:-(e.width_mm+n),xMax:e.width_mm+n,yMin:-(2*n),yMax:2*n,thetaMin:-Math.PI,thetaMax:Math.PI};case"hallway":return{xMin:-n,xMax:e.hallway_width_mm+n,yMin:-(2*n),yMax:2*n,thetaMin:-Math.PI,thetaMax:Math.PI};case"turn":{let t=e.corridor_width_1_mm,i=e.corridor_width_2_mm||t;return{xMin:-n,xMax:Math.max(t,2*n),yMin:-(2*n),yMax:Math.max(i,2*n),thetaMin:-Math.PI,thetaMax:Math.PI}}default:return{xMin:-5e3,xMax:5e3,yMin:-5e3,yMax:5e3,thetaMin:-Math.PI,thetaMax:Math.PI}}}(i,n.length_mm);if(!h(p,m,_,g))return{found:!1,path:[],smoothPath:[],iterations:0,treeSize:1,clearanceProfile:[]};let y=[{config:p,parent:-1,cost:0}];for(let e=0;e<r.maxIterations;e++){let t=function(e,t,n,i,a,o,r){let l,s=0,m=1/0;for(let n=0;n<e.length;n++){let i=d(e[n].config,t);i<m&&(m=i,s=n)}let _=e[s],g=t[0]-_.config[0],p=t[1]-_.config[1],f=c(t[2]-_.config[2]),w=Math.sqrt(g*g+p*p),v=Math.abs(f);if(w<=o&&v<=r)l=[t[0],t[1],t[2]];else{let e=Math.min(w>0?Math.min(1,o/w):1,v>0?Math.min(1,r/v):1);l=[_.config[0]+g*e,_.config[1]+p*e,_.config[2]+f*e]}return h(l,n,i,a)&&u(_.config,l,n,i,a,5)?{config:l,parent:s,cost:_.cost+d(_.config,l)}:null}(y,Math.random()<r.goalBias?[f[0],f[1],f[2]]:[b.xMin+Math.random()*(b.xMax-b.xMin),b.yMin+Math.random()*(b.yMax-b.yMin),b.thetaMin+Math.random()*(b.thetaMax-b.thetaMin)],m,_,g,r.stepSize_mm,r.stepSize_rad);if(t&&(y.push(t),function(e,t,n,i){let a=e[0]-t[0],o=e[1]-t[1],r=Math.sqrt(a*a+o*o),l=Math.abs(c(e[2]-t[2]));return r<n&&l<i}(t.config,f,w,v))){let t=function(e,t){let n=[],i=t;for(;-1!==i;)n.unshift(e[i].config),i=e[i].parent;return n}(y,y.length-1),n=function(e,t,n,i,a){if(e.length<=2)return e;let o=[...e];for(let e=0;e<a&&!(o.length<=2);e++){let e=Math.floor(Math.random()*(o.length-2)),a=o.length-1,r=e+2+Math.floor(Math.random()*(a-e-1));!(r>a)&&u(o[e],o[r],t,n,i,15)&&o.splice(e+1,r-e-1)}return o}(t,m,_,g,r.smoothingPasses),i=function(e,t,n,i,a){if(!e||0===e.length)return[];let o=[];for(let r=0;r<e.length;r++){let l=e[r],s=0,m=500;for(let e=0;e<10;e++){let e=(s+m)/2;h(l,t+e,n+e,i)?s=e:m=e}o.push({t:e.length>1?r/(e.length-1):0,clearance_mm:Math.round(s+a)})}return o}(n,m-l,_-l,g,l);return{found:!0,path:t,smoothPath:n,iterations:e+1,treeSize:y.length,clearanceProfile:i}}}return{found:!1,path:[],smoothPath:[],iterations:r.maxIterations,treeSize:y.length,clearanceProfile:[]}}let g={forklift:{minTurningRadius_mm:2e3,maxTilt_deg:5,minCorridorWidth_mm:1200,maxRotationPerStep_deg:15,label:"Forklift"},dolly:{minTurningRadius_mm:500,maxTilt_deg:10,minCorridorWidth_mm:700,maxRotationPerStep_deg:30,label:"Furniture dolly"},hand_carry:{minTurningRadius_mm:0,maxTilt_deg:45,minCorridorWidth_mm:0,maxRotationPerStep_deg:90,label:"Hand carry"}};function p(e,t){if(!t||!g[t])return{valid:!0,violations:[],adjustedMaxTilt_deg:45};let n=g[t],i=[];for(let t=1;t<e.length;t++){let a=e[t-1],o=e[t],l=Math.abs(c(o[2]-a[2]))*r;if(l>n.maxRotationPerStep_deg&&i.push({step:t,type:"rotation_rate",value:Math.round(l),limit:n.maxRotationPerStep_deg,message:"".concat(n.label," can't rotate ").concat(Math.round(l),"\xb0 in a single move (max ").concat(n.maxRotationPerStep_deg,"\xb0)")}),n.minTurningRadius_mm>0){let e=o[0]-a[0],r=o[1]-a[1],l=Math.sqrt(e*e+r*r),s=Math.abs(c(o[2]-a[2]));if(s>.001&&l>0){let e=l/(2*Math.sin(s/2));e<n.minTurningRadius_mm&&i.push({step:t,type:"turning_radius",value:Math.round(e),limit:n.minTurningRadius_mm,message:"".concat(n.label," turning radius (").concat(Math.round(e),"mm) below minimum (").concat(n.minTurningRadius_mm,"mm)")})}}}return{valid:0===i.length,violations:i,adjustedMaxTilt_deg:n.maxTilt_deg}}let f={marginScore:.4,phaseReliability:.3,constraintCoverage:.3}
1,w={analytical:.95,corner_sweep:.9,rrt_sampling:.75};function v(e,t,n){var i,a;let o;if(!e.found)return null;let{item:l,space:s,constraints:m}=t,d=m.collisionBuffer_mm,h=e.smoothPath,u=e.clearanceProfile,_=1/0,g=0;for(let e=0;e<u.length;e++)u[e].clearance_mm<_&&(_=u[e].clearance_mm,g=e);let p=0;for(let e=1;e<h.length;e++)p+=Math.abs(c(h[e][2]-h[e-1][2]));let v=Math.round(p*r),y=0;for(let e of h)y=Math.max(y,Math.abs(e[2]));let T=Math.round(y*r),I="expert",M="RRT sampling found path with ".concat(_,"mm clearance");for(let e of[{maxClearance:25,maxRot:1/0,level:"expert"},{maxClearance:50,maxRot:45,level:"precision"},{maxClearance:100,maxRot:15,level:"moderate"},{maxClearance:1/0,maxRot:0,level:"straightforward"}])if(_<e.maxClearance||v>e.maxRot){I=e.level;break}if(n&&!n.valid&&(I="expert",M="Equipment constraint violations: ".concat(n.violations.length)),_>50)o="FITS";else if(_>d)o="FITS_TIGHT";else{if(!(_>=0))return null;o="FITS_VERY_TIGHT"}let S=null==(i=t.originalVerdict)?void 0:i.verdict,k=h.map((e,t)=>{var n,i;return{step:t+1,position_mm:[Math.round(e[0]),Math.round(e[1]),0],orientation_deg:[0,0,Math.round(e[2]*r)],orientation_quat:b(e[2]),label:0===t?"Start position":t===h.length-1?"Goal position":"Waypoint ".concat(t),clearance_mm:null!=(i=null==(n=u[t])?void 0:n.clearance_mm)?i:0,deltaRotation_deg:t>0?Math.round(Math.abs(c(e[2]-h[t-1][2]))*r):0}}),N={step:g+1,entities:["item edge","opening"===s.type?"door frame":"turn"===s.type?"inner corner":"hallway wall"],axis:"rrt_swept",clearance_mm:_,marginPercent:Math.round(_/(s.width_mm||s.hallway_width_mm||s.corridor_width_1_mm||1)*100),belowSafetyThreshold:_<d},x=function(e,t){if(!e||e.length<2)return[];let n=[],i=e.length-1;for(let s=0;s<i;s++){var a,o,r,l;let m=e[s],d=e[s+1],h=null!=(r=null==(a=t[s])?void 0:a.clearance_mm)?r:0,u=null!=(l=null==(o=t[s+1])?void 0:o.clearance_mm)?l:0,_=s===i-1?6:5;for(let e=0;e<_;e++){let t=e/5,a=(s+t)/i,o=m[0]+(d[0]-m[0])*t,r=m[1]+(d[1]-m[1])*t,l=m[2]+c(d[2]-m[2])*t,_=h+(u-h)*t;n.push({t:Math.round(1e3*a)/1e3,position_mm:[Math.round(o),Math.round(r),0],orientation_quat:b(l),clearance_mm:Math.round(_)})}}return n}(h,u),{confidence:E,factors:D}=function(e){let{margin_mm:t,buffer_mm:n,has3D:i,hasDepth:a,method:o="analytical",weights:r=f,equipmentViolations:l=0}=e,s=Math.min(1,Math.max(0,t/100)),m=w[o]||.75,c=0;i||(c+=.1),a||(c+=.05),l>0&&(c+=Math.min(.3,.05*l));let d=Math.max(0,1-c);return{confidence:Math.round(100*Math.min(1,Math.max(0,s*r.marginScore+m*r.phaseReliability+d*r.constraintCoverage-c)))/100,factors:{marginScore:Math.round(100*s)/100,assumptionPenalty:Math.round(100*c)/100,phaseReliability:m,constraintCoverage:Math.round(100*d)/100}}}({margin_mm:_,buffer_mm:d,has3D:!!l.height_mm,hasDepth:!!s.depth_mm,method:"rrt_sampling",equipmentViolations:(null==n||null==(a=n.violations)?void 0:a.length)||0}),F=[];l.height_mm||F.push("Height not checked — 2D path planning only"),s.depth_mm||"opening"!==s.type||F.push("Wall depth unknown — approach clearance not verified"),F.push("RRT explored ".concat(e.treeSize," configurations in ").concat(e.iterations," iterations"));let C=[];if(N.belowSafetyThreshold&&C.push("Clearance (".concat(_,"mm) is below the ").concat(d,"mm safety buffer")),n&&!n.valid)for(let e of n.violations)C.push(e.message);return C.push("Path found via sampling — on-site verification strongly recommended"),{found:!0,verdict:o,upgradedFromOriginal:"DOESNT_FIT"===S||"UNKNOWN"===S,confidence:E,confidenceFactors:D,path:k,tightestPoint:N,requiredAngle_deg:T,approachDistance_mm:Math.round(Math.sqrt(h[0][0]**2+h[0][1]**2)),totalRotation_deg:v,difficulty:I,difficultyReason:M,animationPath:x,method:"rrt_sampling",phasesAttempted:["phase1_analytical","phase2_corner_sweep","phase3_rrt"],samplesChecked:e.treeSize,assumptions:F,warnings:C,rrtDetails:{iterations:e.iterations,treeSize:e.treeSize,rawPathLength:e.path.length,smoothPathLength:e.smoothPath.length,equipmentViolations:(null==n?void 0:n.violations)||[]}}}function b(e){let t=e/2;return[0,0,Math.sin(t),Math.cos(t)]}var y=n(89609);let T=Math.PI/180;function I(e,t){return e>100&&0===t?{difficulty:"straightforward",reason:"Plenty of clearance, no rotation needed"}:e>=50&&e<=100||t>0&&t<15?{difficulty:"moderate",reason:e<100?"Clearance is ".concat(Math.round(e),"mm — manageable but watch edges"):"Slight angle (".concat(Math.round(t),"\xb0) needed")}:e>=25&&e<50||t>=15&&t<=45?{difficulty:"precision",reason:e<50?"Only ".concat(Math.round(e),"mm clearance — careful alignment required"):"".concat(Math.round(t),"\xb0 rotation through tight opening")}:{difficulty:"expert",reason:e<25?"Extremely tight — ".concat(Math.round(e),"mm clearance"):"Steep ".concat(Math.round(t),"\xb0 angle maneuver")}}function M(e,t,n){let i;if(e>50)i="FITS";else if(e>t)i="FITS_TIGHT";else{if(!(e>=0))return{verdict:null,upgradedFromOriginal:!1};i="FITS_VERY_TIGHT"}return{verdict:i,upgradedFromOriginal:"DOESNT_FIT"===n||"UNKNOWN"===n}}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return[0,t,e]}function k(e){let[t,n,i]=e.map(e=>e*T),a=Math.cos(t/2),o=Math.sin(t/2),r=Math.cos(n/2),l=Math.sin(n/2),s=Math.cos(i/2),m=Math.sin(i/2);return[o*r*s-a*l*m,a*l*s+o*r*m,a*r*m-o*l*s,a*r*s+o*l*m]}function N(e,t,n,i,a,o){let{acrossHallway:r,alongHallway:l}=n,s=l+200;return[{step:1,position_mm:[0,-s,0],orientation_deg:S(0),orientation_quat:k(S(0)),label:"Approach along corridor 1",clearance_mm:Math.round(a-r),deltaRotation_deg:0},{step:2,position_mm:[0,-(l/2),0],orientation_deg:S(0),orientation_quat:k(S(0)),label:"Begin rotation at corner entry point",clearance_mm:Math.round(a-r),deltaRotation_deg:0},{step:3,position_mm:[0,0,0],orientation_deg:S(45),orientation_quat:k(S(45)),label:"Item pivots around inner corner — tightest point",clearance_mm:Math.round(i),deltaRotation_deg:45},{step:4,position_mm:[l/2,0,0],orientation_deg:S(90),orientation_quat:k(S(90)),label:"Complete rotation into corridor 2",clearance_mm:Math.round(o-r),deltaRotation_deg:45},{step:5,position_mm:[s,0,0],orientation_deg:S(90),orientation_quat:k(S(90)),label:"Advance along corridor 2",clearance_mm:Math.round(o-r),deltaRotation_deg:0}]}function x(e){if(e.length<2)return[];let t=[],n=e.length-1;for(let i=0;i<e.length;i++){let a=e[i],o=i/n;if(t.push({t:Math.round(1e3*o)/1e3,pos:a.position_mm,quat:a.orientation_quat,clearance_mm:a.clearance_mm}),i<n){let r=e[i+1];for(let e=1;e<=5;e++){let i=e/6,l=o+i/n;t.push({t:Math.round(1e3*l)/1e3,pos:[a.position_mm[0]+(r.position_mm[0]-a.position_mm[0])*i,a.position_mm[1]+(r.position_mm[1]-a.position_mm[1])*i,a.position_mm[2]+(r.position_mm[2]-a.position_mm[2])*i],quat:function(e,t,n){let i=[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n,e[3]+(t[3]-e[3])*n],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]+i[3]*i[3]);return a>0&&(i[0]/=a,i[1]/=a,i[2]/=a,i[3]/=a),i}(a.orientation_quat,r.orientation_quat,i),clearance_mm:Math.round(a.clearance_mm+(r.clearance_mm-a.clearance_mm)*i)})}}}return t}function E(e,t,n,i){let a=Math.min(1,Math.max(0,e/100)),o=0;n||(o+=.1),i||(o+=.05);let r=1-o;return{confidence:Math.round(100*Math.min(1,Math.max(0,.4*a+.285+.3*r-o)))/100,factors:{marginScore:Math.round(100*a)/100,assumptionPenalty:Math.round(100*o)/100,phaseReliability:.95,constraintCoverage:Math.round(100*r)/100}}}var D=n(14103);let F=["opening","hallway","turn","elevator","container"],C=["forklift","dolly","hand_carry",null],O=["FITS","FITS_TIGHT","FITS_VERY_TIGHT","DOESNT_FIT","FITS_WONT_CLOSE","UNKNOWN"],R=new Map;function A(e){var t;let{item:n,space:i,constraints:a}=e,o=["i:".concat(n.length_mm,",").concat(n.width_mm,",").concat(null!=(t=n.height_mm)?t:"null"),"s:".concat(i.type)];for(let e of Object.keys(i).filter(e=>"type"!==e&&null!=i[e]).sort())o.push("".concat(e,":").concat(i[e]));o.push("buf:".concat(a.collisionBuffer_mm)),o.push("tilt:".concat(a.maxTilt_deg)),o.push("horiz:".concat(a.horizontalOnly)),a.equipment&&o.push("eq:".concat(a.equipment));let r=o.join("|"),l=0x811c9dc5;for(let e=0;e<r.length;e++)l^=r.charCodeAt(e),l=Math.imul(l,0x1000193);return(l>>>0).toString(16).padStart(8,"0")}function L(e,t){if(!(0,D.G)()){if(R.size>=500){let e=R.keys().next().value;R.delete(e)}R.set(e,t)}}async function P(e,t){if((0,D.G)()||!e)return null;try{let{data:n,error:i}=await e.from("maneuver_cache").select("result_json").eq("pose_hash",t).maybeSingle();if(i||!n)return null;return n.result_json}catch(e){return null}}function U(e,t,n,a){if(!(0,D.G)()&&e)try{e.from("maneuver_cache").upsert({pose_hash:t,space_type:a.space.type,phase_used:n.method||"stub",result_json:n,compute_time_ms:n.computeTime_ms||0},{onConflict:"pose_hash"}).then(e=>{let{error:t}=e;t&&i.U.warn("[maneuver-cache] Supabase write failed:",t.message)}
1).catch(()=>{})}catch(e){}}let H=Math.PI/180;var W=n(95704);let G=Math.PI/180;function q(e,t,n,i,a){let r={width_mm:e.width_mm,depth_mm:e.length_mm,height_mm:e.height_mm},l=(0,o.Rw)(r),s=null;for(let e of l){if(null==e.alongHallway)continue;let o=function(e,t,n,i){let{acrossHallway:a,vertical:o,alongHallway:r}=e,l=Math.min(t-a,n-a),s=i-o;if(l<0||s<0||null==r)return null;let m=(0,y.fI)(a,t,n);return null==m?null:{cornerMargin:m-r,widthMargin:l,heightMargin:s,bMax:m}}(e,t,n,i);if(!o)continue;let r=Math.min(o.cornerMargin,o.widthMargin,o.heightMargin);r<-a||(!s||r>s.limitingMargin)&&(s={orientation:e,...o,limitingMargin:r})}return s}async function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Date.now(),o=function(e){var t,n,i,a,o,r,l,s,m,c;if(!e)throw Error("ManeuverDiscovery: input is required");let{item:d}=e;if(!d)throw Error("ManeuverDiscovery: item is required");if(!d.length_mm||d.length_mm<=0)throw Error("ManeuverDiscovery: item.length_mm must be > 0");if(!d.width_mm||d.width_mm<=0)throw Error("ManeuverDiscovery: item.width_mm must be > 0");if(null!=d.height_mm&&d.height_mm<=0)throw Error("ManeuverDiscovery: item.height_mm must be > 0 if provided");let{space:h}=e;if(!h)throw Error("ManeuverDiscovery: space is required");if(!F.includes(h.type))throw Error("ManeuverDiscovery: space.type must be one of: ".concat(F.join(", ")));switch(h.type){case"opening":if(!h.width_mm||!h.height_mm)throw Error("ManeuverDiscovery: opening requires width_mm and height_mm");break;case"hallway":if(!h.hallway_width_mm)throw Error("ManeuverDiscovery: hallway requires hallway_width_mm");break;case"turn":if(!h.corridor_width_1_mm)throw Error("ManeuverDiscovery: turn requires corridor_width_1_mm")}let u={maxTilt_deg:null!=(o=null==(t=e.constraints)?void 0:t.maxTilt_deg)?o:45,horizontalOnly:null!=(r=null==(n=e.constraints)?void 0:n.horizontalOnly)&&r,equipment:null!=(l=null==(i=e.constraints)?void 0:i.equipment)?l:null,collisionBuffer_mm:null!=(s=null==(a=e.constraints)?void 0:a.collisionBuffer_mm)?s:25};if(u.equipment&&!C.includes(u.equipment))throw Error("ManeuverDiscovery: equipment must be one of: ".concat(C.filter(
1Boolean).join(", ")));let _=null!=(m=e.originalVerdict)?m:{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_NOT_COMPUTED"};if(!O.includes(_.verdict))throw Error("ManeuverDiscovery: originalVerdict.verdict must be one of: ".concat(O.join(", ")));return{item:{length_mm:d.length_mm,width_mm:d.width_mm,height_mm:null!=(c=d.height_mm)?c:null,name:d.name||"item"},space:h,constraints:u,originalVerdict:_}}(e),r=A(o),l=e=>{if(!(null==e?void 0:e.found)||!Array.isArray(e.path)||e.path.length<2||!e.method)return e;let t=A({item:{length_mm:1,width_mm:1,height_mm:1},space:{type:"opening",width_mm:1,height_mm:1},constraints:{maxTilt_deg:o.constraints.maxTilt_deg,horizontalOnly:o.constraints.horizontalOnly,collisionBuffer_mm:o.constraints.collisionBuffer_mm,equipment:o.constraints.equipment},originalVerdict:{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_NOT_COMPUTED"}});return{...e,maneuver_proof:{method:e.method,solver_input_fingerprint:r,solver_config_fingerprint:"maneuver-config-v1-".concat(t),proof_schema_version:"maneuver-proof-v1",path_states:e.path,termination_status:"path_found",support_label:"rrt_sampling"===e.method?"bounded_search":"deterministic"}}},s=(0,D.G)()?null:R.get(r)||null;if(s)return l({...s,computeTime_ms:0,cacheHit:"memory"});let m=await P(t.supabase||null,r);if(m)return L(r,m),l({...m,computeTime_ms:0,cacheHit:"supabase"});let c=function(e){let{item:t,space:n,constraints:i}=e,o=i.collisionBuffer_mm;if("opening"!==n.type&&"hallway"!==n.type)return null;let r=t.length_mm,l=t.width_mm,s=t.height_mm,m="opening"===n.type?n.width_mm:n.hallway_width_mm,c="opening"===n.type?n.height_mm:n.hallway_height_mm||null,d=n.depth_mm||null,h=m-2*o;if(h<=0)return null;let u=[];d||u.push("Wall/door depth unknown — assumed no depth constraint"),!c&&s&&u.push("Space height unknown — only horizontal clearance checked");let _=0,g=-1/0;for(let e=0;e<=90;e++){let t=e*G,n=h-(0,a.u3)(r,l,t);n>g&&(g=n,_=e)}let p=0,f=1/0;if(s&&c&&(f=c-s)<0&&!i.horizontalOnly&&i.maxTilt_deg>0){let e=f;for(let t=1;t<=i.maxTilt_deg;t++){let n=t*G,i=c-(s*Math.cos(n)+l*Math.sin(n));i>e&&(e=i,p=t)}f=e}if(d&&_>0){let e=r*Math.cos(_*G);e>3*d&&u.push("Item requires ".concat(Math.round(e),"mm approach depth for angled entry"))}let w=g>-o,v=f>-o;if(!w||!v)return null;let b=Math.min(g,f===1/0?g:f),{verdict:y,upgradedFromOriginal:N}=M(b,o,e.originalVerdict.verdict);if(!y)return null;let{difficulty:D,reason:F}=I(b,_),C="opening"===n.type?function(e,t,n,i,a){let o=n*T,r=e.length_mm,l=e.width_mm,s=(r*Math.cos(o)+l*Math.sin(o))/2+200,m=t.depth_mm||150,c=[];if(n<1)c.push({step:1,position_mm:[0,-s,0],orientation_deg:S(0),orientation_quat:k(S(0)),label:"Approach straight",clearance_mm:Math.round(i),deltaRotation_deg:0}),c.push({step:2,position_mm:[0,0,0],orientation_deg:S(0),orientation_quat:k(S(0)),label:"Pass through opening",clearance_mm:Math.round(i),deltaRotation_deg:0}),c.push({step:3,position_mm:[0,m+200,0],orientation_deg:S(0),orientation_quat:k(S(0)),label:"Clear opening",clearance_mm:Math.round(i),deltaRotation_deg:0});else{let e=S(n),d=S(0);c.push({step:1,position_mm:[0,-s,0],orientation_deg:e,orientation_quat:k(e),label:"Position at ".concat(Math.round(n),"\xb0 angle"),clearance_mm:Math.round(t.width_mm-l),deltaRotation_deg:Math.round(n)}),c.push({step:2,position_mm:[0,-(r*Math.cos(o))/2,0],orientation_deg:e,orientation_quat:k(e),label:"Leading edge enters opening",clearance_mm:Math.round(i+a),deltaRotation_deg:0}),c.push({step:3,position_mm:[0,0,0],orientation_deg:e,orientation_quat:k(e),label:"Midpoint in opening — tightest point",clearance_mm:Math.round(i),deltaRotation_deg:0}),c.push({step:4,position_mm:[0,r*Math.cos(o)/2,0],orientation_deg:e,orientation_quat:k(e),label:"Trailing edge clears opening",clearance_mm:Math.round(i+a),deltaRotation_deg:0}),c.push({step:5,position_mm:[0,m+200,0],orientation_deg:d,orientation_quat:k(d),label:"Straighten to final orientation",clearance_mm:Math.round(t.width_mm-l),deltaRotation_deg:Math.round(n)})}return c}(t,n,_,g,o):function(e,t,n,i){let a=S(n),o=S(0),r=t.hallway_length_mm||3e3,l=[];return n<1?(l.push({step:1,position_mm:[0,0,0],orientation_deg:o,orientation_quat:k(o),label:"Enter hallway straight",clearance_mm:Math.round(i),deltaRotation_deg:0}),l.push({step:2,position_mm:[0,r,0],orientation_deg:o,orientation_quat:k(o),label:"Traverse hallway",clearance_mm:Math.round(i),deltaRotation_deg:0})):(l.push({step:1,position_mm:[0,0,0],orientation_deg:a,orientation_quat:k(a),label:"Angle item at ".concat(Math.round(n),"\xb0 to fit width"),clearance_mm:Math.round(i),deltaRotation_deg:Math.round(n)}),l.push({step:2,position_mm:[0,r/2,0],orientation_deg:a,orientation_quat:k(a),label:"Slide along hallway at angle",clearance_mm:Math.round(i),deltaRotation_deg:0}),l.push({step:3,position_mm:[0,r,0],orientation_deg:o,orientation_quat:k(o),label:"Straighten at hallway exit",clearance_mm:Math.round(i),deltaRotation_deg:Math.round(n)})),l}(0,n,_,g);if(p>0){for(let e of C)e.orientation_deg[1]=p,e.orientation_quat=k(e.orientation_deg);u.push("Tilted ".concat(p,"\xb0 to clear height"))}let O=C.reduce((e,t)=>
1t.clearance_mm<e.clearance_mm?t:e,C[0]),R={step:O.step,entities:["item edge","opening"===n.type?"door frame":"hallway wall"],axis:"width",clearance_mm:O.clearance_mm,marginPercent:Math.round(O.clearance_mm/m*100),belowSafetyThreshold:O.clearance_mm<o},{confidence:A,factors:L}=E(b,o,!!s&&!!c,!!d),P=_*(C.filter(e=>e.deltaRotation_deg>0).length>1?2:1),U=C[0]?Math.abs(C[0].position_mm[1]):0;return{found:!0,verdict:y,upgradedFromOriginal:N,confidence:A,confidenceFactors:L,path:C,tightestPoint:R,requiredAngle_deg:_,approachDistance_mm:Math.round(U),totalRotation_deg:Math.round(P),difficulty:D,difficultyReason:F,animationPath:x(C),method:"analytical",phasesAttempted:["phase1_analytical"],samplesChecked:91,assumptions:u,warnings:R.belowSafetyThreshold?["Clearance (".concat(R.clearance_mm,"mm) is below the ").concat(o,"mm safety buffer")]:[]}}(o);if(c){let e={...c,poseHash:r,computeTime_ms:Date.now()-n,billingKey:"maneuver_discovery_p1"};return L(r,e),U(t.supabase||null,r,e,o),l(e)}let d=function(e){let{item:t,space:n,constraints:i}=e,a=i.collisionBuffer_mm;if("turn"!==n.type||!t.height_mm)return null;let o=n.corridor_width_1_mm,r=n.corridor_width_2_mm||o,l=n.ceiling_height_mm||2400,s=n.turn_angle||90,m=[],c=[];n.corridor_width_2_mm||m.push("Assumed equal corridor widths on both sides of turn"),n.ceiling_height_mm||m.push("Assumed standard ceiling height: 8ft"),o!==r&&Math.abs(o-r)/Math.max(o,r)>.2&&c.push("Asymmetric corridor — clearance differs significantly between entry and exit sides");let d=0;if(180===s){let i=q(t,o,r,l,a),s=q(t,r,o,l,a);if(d=12,!i||!s)return null;let h=i.limitingMargin<=s.limitingMargin?i:s,u=h.limitingMargin,{verdict:_,upgradedFromOriginal:g}=M(u,a,e.originalVerdict.verdict);if(!_)return null;let{difficulty:p,reason:f}=I(u,180);m.push("U-turn decomposed into two sequential 90\xb0 turns — worst-case returned");let w=N(t,n,i.orientation,i.cornerMargin,o,r),v=N(t,n,s.orientation,s.cornerMargin,r,o),b=w[w.length-1],y=v.map((e,t)=>({...e,step:w.length+t+1,position_mm:[b.position_mm[0]+e.position_mm[0],b.position_mm[1]+e.position_mm[1],(b.position_mm[2]||0)+(e.position_mm[2]||0)],orientation_deg:S(e.orientation_deg[2]+90),orientation_quat:k(S(e.orientation_deg[2]+90))})),T=[...w,...y],D=T.reduce((e,t)=>t.clearance_mm<e.clearance_mm?t:e,T[0]),F={step:D.step,entities:["item edge","inner corner"],axis:"diagonal",clearance_mm:D.clearance_mm,marginPercent:Math.round(D.clearance_mm/Math.min(o,r)*100),belowSafetyThreshold:D.clearance_mm<a},{confidence:C,factors:O}=E(u,a,!0,!1);return{found:!0,verdict:_,upgradedFromOriginal:g,confidence:C,confidenceFactors:O,path:T,tightestPoint:F,requiredAngle_deg:180,approachDistance_mm:Math.round(h.orientation.alongHallway+200),totalRotation_deg:180,difficulty:p,difficultyReason:f,animationPath:x(T),method:"corner_sweep",phasesAttempted:["phase1_analytical","phase2_corner_sweep"],samplesChecked:d,assumptions:m,warnings:[...F.belowSafetyThreshold?["Clearance (".concat(F.clearance_mm,"mm) is below the ").concat(a,"mm safety buffer")]:[],...c],turnDetails:{type:"u_turn",leg1:{w1:o,w2:r,margin_mm:Math.round(i.limitingMargin),bMax_mm:Math.round(i.bMax)},leg2:{w1:r,w2:o,margin_mm:Math.round(s.limitingMargin),bMax_mm:Math.round(s.bMax)}}}}let h=null,u=null;for(let e of o!==r?[{entry:o,exit:r,label:"wider-to-narrow"},{entry:r,exit:o,label:"narrow-to-wider"}]:[{entry:o,exit:r,label:"symmetric"}]){let n=q(t,e.entry,e.exit,l,a);d+=6,n&&(!h||n.limitingMargin>h.limitingMargin)&&(h=n,u=e)}if(!h)return null;let _=h.limitingMargin,{verdict:g,upgradedFromOriginal:p}=M(_,a,e.originalVerdict.verdict);if(!g)return null;let{difficulty:f,reason:w}=I(_,90);o!==r&&"narrow-to-wider"===u.label&&m.push("Best approach is entering from the narrower corridor side");let v=N(t,n,h.orientation,h.cornerMargin,u.entry,u.exit),b=v.reduce((e,t)=>t.clearance_mm<e.clearance_mm?t:e,v[0]),y={step:b.step,entities:["item edge","inner corner"],axis:"diagonal",clearance_mm:b.clearance_mm,marginPercent:Math.round(b.clearance_mm/Math.min(o,r)*100),belowSafetyThreshold:b.clearance_mm<a},{confidence:T,factors:D}=E(_,a,!0,!1);return{found:!0,verdict:g,upgradedFromOriginal:p,confidence:T,confidenceFactors:D,path:v,tightestPoint:y,requiredAngle_deg:90,approachDistance_mm:Math.round(h.orientation.alongHallway+200),totalRotation_deg:90,difficulty:f,difficultyReason:w,animationPath:x(v),method:"corner_sweep",phasesAttempted:["phase1_analytical","phase2_corner_sweep"],samplesChecked:d,assumptions:m,warnings:[...y.belowSafetyThreshold?["Clearance (".concat(y.clearance_mm,"mm) is below the ").concat(a,"mm safety buffer")]:[],...c],turnDetails:{type:"l_turn",entryWidth_mm:u.entry,exitWidth_mm:u.exit,direction:u.label,bMa
1x_mm:Math.round(h.bMax),bestOrientation:{across_mm:h.orientation.acrossHallway,vertical_mm:h.orientation.vertical,along_mm:h.orientation.alongHallway}}}}(o);if(d){let e={...d,poseHash:r,computeTime_ms:Date.now()-n,billingKey:"maneuver_discovery_p2"};return L(r,e),U(t.supabase||null,r,e,o),l(e)}if(t.premiumUser){let e=_({item:o.item,space:o.space,constraints:o.constraints,options:t.rrtOptions||{}}),i=o.constraints.equipment?p(e.smoothPath||[],o.constraints.equipment):{valid:!0,violations:[],adjustedMaxTilt_deg:45},a=v(e,o,i);if(a){let e={...a,poseHash:r,computeTime_ms:Date.now()-n,billingKey:"maneuver_discovery_p3"};return L(r,e),U(t.supabase||null,r,e,o),l(e)}}let h={found:!1,verdict:null,upgradedFromOriginal:!1,confidence:0,confidenceFactors:{marginScore:0,assumptionPenalty:0,phaseReliability:0,constraintCoverage:0},poseHash:r,path:[],tightestPoint:null,requiredAngle_deg:0,approachDistance_mm:0,totalRotation_deg:0,difficulty:null,difficultyReason:"Discovery not yet run — stub result",animationPath:[],method:null,phasesAttempted:[],samplesChecked:0,computeTime_ms:Date.now()-n,assumptions:[],warnings:["Stub result — algorithm not yet implemented"]};if(h.billingKey="maneuver_discovery_p1",h.phasesAttempted=t.premiumUser?["phase1_analytical","phase2_corner_sweep","phase3_rrt"]:["phase1_analytical","phase2_corner_sweep"],h.semantic_outcome="incomplete_search","off"!==function(){let e=String(void 0!==W&&W.env.MANEUVER_RRT_3D||"off").toLowerCase();return"shadow"===e||"live"===e?e:"off"}())try{let e=function(){let{item:e,opening:t,maxTilt_deg:n=30}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e||!t||!Number.isFinite(e.W)||!Number.isFinite(e.H)||!Number.isFinite(t.W)||!Number.isFinite(t.H)||e.H<=t.H&&e.W<=t.W)return!1;for(let i=1;i<=n;i++){let n=i*H,a=e.H*Math.cos(n)+e.W*Math.sin(n),o=e.W*Math.cos(n)+e.H*Math.sin(n);if(a<=t.H&&o<=t.W)return!0}return!1}({item:{W:o.item.width_mm,H:o.item.height_mm},opening:{W:o.space.width_mm,H:o.space.height_mm},maxTilt_deg:o.constraints.maxTilt_deg});i.U.log("[MANEUVER-RRT-3D-SHADOW]",JSON.stringify({missed_tilt_path:e,space_type:o.space.type}))}catch(e){}return h}async function z(e){var t,n,i,a,o,r,l,s;let m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=Date.now();if(!(null==e?void 0:e.items)||0===e.items.length)throw Error("ManeuverDiscovery: items array is required for multi-item maneuver");if(1===e.items.length)return j({item:e.items[0],space:e.space,constraints:e.constraints,originalVerdict:e.originalVerdict},m);for(let t=0;t<e.items.length;t++){let n=e.items[t];if(!n.length_mm||n.length_mm<=0)throw Error("ManeuverDiscovery: items[".concat(t,"].length_mm must be > 0"));if(!n.width_mm||n.width_mm<=0)throw Error("ManeuverDiscovery: items[".concat(t,"].width_mm must be > 0"))}let d=e.space;if(!d||!F.includes(d.type))throw Error("ManeuverDiscovery: space.type must be one of: ".concat(F.join(", ")));let h={maxTilt_deg:null!=(o=null==(t=e.constraints)?void 0:t.maxTilt_deg)?o:45,horizontalOnly:null!=(r=null==(n=e.constraints)?void 0:n.horizontalOnly)&&r,equipment:null!=(l=null==(i=e.constraints)?void 0:i.equipment)?l:null,collisionBuffer_mm:null!=(s=null==(a=e.constraints)?void 0:a.collisionBuffer_mm)?s:25},u=[],g=!0,f=[];for(let t=0;t<e.items.length;t++){let n={item:e.items[t],space:d,constraints:h,originalVerdict:e.originalVerdict||{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_NOT_COMPUTED"}},i=await j(n,m);u.push(i),i.found||(g=!1,f.push(t))}if(!g&&m.premiumUser&&f.length>0){let t=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||0===e.length)return{ordering:[],results:[],allFeasible:!1,totalComputeTime_ms:0};let a=Date.now();if(1===e.length){let o=_({item:e[0],space:t,constraints:n,options:i});return{ordering:[0],results:[o],allFeasible:o.found,totalComputeTime_ms:Date.now()-a}}let o=e.map((e,t)=>({item:e,idx:t,maxDim:Math.max(e.length_mm,e.width_mm,e.height_mm||0)}));o.sort((e,t)=>t.maxDim-e.maxDim);let r=o.map(e=>e.idx),l=[],s=!0;for(let{item:e}of o){let a=_({item:e,space:t,constraints:n,options:i});l.push(a),a.found||(s=!1)}return{ordering:r,results:l,allFeasible:s,totalComputeTime_ms:Date.now()-a}}(f.map(t=>e.items[t]),d,h,m.rrtOptions||{});for(let n=0;n<f.length;n++){let i=f[n],a=t.results[n];if(a.found){let n=h.equipment?p(a.smoothPath||[],h.equipment):{valid:!0,violations:[],adjustedMaxTilt_deg:45},o=v(a,{item:e.items[i],space:d,constraints:h,originalVerdict:e.originalVerdict||{verdict:"UNKNOWN",margin_mm:null,margin_unknown_reason:"MARGIN_NOT_COMPUTED"}},n);o&&(u[i]={...o,billingKey:"maneuver_discovery_p3",computeTime_ms:t.totalComputeTime_ms})}}}g=u.every(e=>e.found);let w=u.filter(e=>e.found),b=w.length>0?Math.min(...w.map(e=>{var t,n;return null!=(n=null==(t=e.tightestPoint)?void 0:t.clearance_mm)?n:1/0})):0;return{multiItem:!0,allFeasible:g,itemCount:e.items.length,perItemResults:u,worstClearance_mm:Math.round(b),overallDifficulty:g?w.reduce((e,t)=>
1{let n=["straightforward","moderate","precision","expert"];return n.indexOf(t.difficulty)>n.indexOf(e)?t.difficulty:e},"straightforward"):null,computeTime_ms:Date.now()-c,billingKey:m.premiumUser&&f.length>0?"maneuver_discovery_p3":"maneuver_discovery_p2"}}},56381:(e,t,n)=>{n.d(t,{HK:()=>c,buildReverseFitResponse:()=>u,s9:()=>d});var i=n(58271),a=n(17192),o=n(7360),r=n(95704);function l(e,t){if(!(null==e?void 0:e.recommended)||e.recommended.displayBox_mm)return;let n=e.recommended.tightBox_mm;if(!n)return;let i="cm"===t||"mm"===t?50:50.8,a=e=>Math.ceil(e/i)*i;e.recommended.displayBox_mm={length:a(n.length),width:a(n.width),height:a(n.height)}}let s=1/25.4;function m(e){return Math.round((e||0)*s*10)/10}function c(e,t){var n,i,r;if(!e||"RECOMMENDED"!==e.verdict)return null;let s=e.recommended;if(!s)return null;let c=null==(n=s.arrangement)?void 0:n.placements;if(!Array.isArray(c)||0===c.length)return null;s.displayBox_mm||l(e,t);let d=s.displayBox_mm;if(!d)return null;let h=c.map((e,t)=>{let n=e.orientation||{},i=e.position||{},a={width:m(n.w),depth:m(n.l),height:m(n.h)};return{label:"Item ".concat(t+1),dimensions:a,fits:!0,solverPosition_mm:{x:i.x,y:i.y,z:i.z},bestOrientation:{...a}}}),u="cm"===t||"mm"===t?"metric":"imperial",_=null!=(r=null==(i=e.summary)?void 0:i.totalItems)?r:h.length,g=function(e,t){if(!e)return"";let n=(0,o.x)(t),i=e=>(0,a.ix)({mm:e,role:"space-dimensions",source:"solver"},n,{context:"prose",precision:"rough"});return"".concat(i(e.length)," \xd7 ").concat(i(e.width)," \xd7 ").concat(i(e.height))}(d,t);return{_schemaVersion:1,container:{label:"Recommended box",type:"custom",closureType:"open",dimensions:{width:m(d.width),depth:m(d.length),height:m(d.height)}},items:h,preferred_unit:u,visualization_hint:"cutaway",entry_direction:"front",ai_summary:"Recommended box holds ".concat(_," item").concat(1===_?"":"s","."),queryIntent:"containment",queryEnvironment:"container",_reverseFit:!0,_reverseFitVerdict:"FITS",_boxSizing:!0,_boxDimsLabel:g,_displayBox_mm:{...d}}}function d(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{userUnit:s="in"}=r;if(i.U.log("[RF-TRACE 5] generateReverseFitResponse called:",JSON.stringify({spaceType:t,hasSolverResult:!!e,verdict:null==e?void 0:e.verdict,hasRecommended:!!(null==e?void 0:e.recommended),hasItemBreakdown:!!(null==e?void 0:e.itemBreakdown),hasFailed:!!(null==e?void 0:e.failed),hasSummary:!!(null==e?void 0:e.summary),keys:e?Object.keys(e).slice(0,20):[]})),(null==e?void 0:e.solverKind)==="box-sizing"){if("RECOMMENDED"===e.verdict)return function(e,t){var n,i,r;e.recommended.displayBox_mm||l(e,t);let{length:s,width:m,height:c}=e.recommended.displayBox_mm,d=(0,o.x)(t),h=e=>(0,a.ix)({mm:e,role:"space-dimensions",source:"solver"},d,{context:"prose",precision:"rough"}),u="".concat(h(s)," \xd7 ").concat(h(m)," \xd7 ").concat(h(c)),_=null!=(r=null==(n=e.summary)?void 0:n.totalItems)?r:0,g=(null==(i=e.recommended.arrangement)?void 0:i.description)||"computed packing arrangement",p="computed packing arrangement"===g?"":", ".concat(g),f=1===_?"this item":"all ".concat(_," items");return"MEDIUM"===e.confidence?"**FITS** ✓ — A ".concat(u," box will hold ").concat(f).concat(p,". A smaller box may also work — share a candidate and I'll verify."):"**FITS** ✓ — A ".concat(u," box holds ").concat(f).concat(p,".")}(e,s);switch(e.failureReason){case"no_fit_under_cap":return"**NO SINGLE BOX** ✕ — These items would need a box larger than 2 m on a side, which isn't a standard cardboard box. Consider splitting into multiple boxes or sharing interior dims of a specific container.";case"pack_timeout":return"**NEEDS MORE INFO** ✕ — I couldn't compute a confident one-box recommendation quickly. Try splitting the items, or share a maximum box size to check.";case"empty_items":return"**NEEDS MORE INFO** ✕ — Tell me what items you want to pack.";case"too_many_items":return"**NEEDS MORE INFO** ✕ — I can recommend a box for up to 200 items at once; for larger inventories, share a sample subset.";case"missing_dims":return"**NEEDS MORE INFO** ✕ — I need dimensions for the items you listed before I can compute a box size.";default:return"**NEEDS MORE INFO** ✕ — Couldn't compute a recommendation — please share interior dims of a specific box to verify fit."}}let{verdict:m,recommended:c,alsoFits:d,failed:u,summary:_,itemBreakdown:g}=e;if("EXCEEDS_ALL"===m)return function(e,t){var n;let{summary:i,ladder:a,confidence:o}=e,r={vehicle:"TRUCK",storage:"STORAGE UNIT",container:"CONTAINER",room:"ROOM",pod:"POD"}[t]||"SPACE",l=r.toLowerCase(),s=(null==i?void 0:i.totalItems)||0,m=1===s,c=null==(n=e.itemBreakdown)?void 0:n[0],d=(null==c?void 0:c.name)||"item",h=function(e){var t;let{failed:n,ladder:i}=e||{},a=n&&n.length?n:(i||[]).filter(e=>!e.fits),o={};for(let e of a)e.reason&&(o[e.reason]=(o[e.reason]||0)+1);return(null==(t=Object.entries(o).sort((e,t)=>
1t[1]-e[1])[0])?void 0:t[0])||null}(e),u={door:"door opening",payload:"weight limit",height:"ceiling height",floor_area:"floor space",row_packing:"packing layout"}[h]||"available space",_=[];if(m){let e=(null==c?void 0:c.dims)?" (".concat(c.dims,")"):"";_.push("**NO STANDARD ".concat(r," FITS THIS ").concat(d.toUpperCase(),"** ✕")),_.push("","The ".concat(d).concat(e," exceeds every standard ").concat(l," we checked.")),_.push("","**Why:** the limiting factor is the **".concat(u,"**").concat("door"===h?", not interior volume":"","."))}else _.push("**NO SINGLE ".concat(r," FITS** ✕")),_.push("","".concat(s," items (~").concat((i.totalVolume_ft3||0).toLocaleString()," ft\xb3, ").concat((i.totalWeight_lbs||0).toLocaleString()," lbs) exceed every standard ").concat(l," we checked.\n")+"No single ".concat(l," can carry this load in one trip.")),(null==i?void 0:i.keyConstraint)&&_.push("","**Limiting factor:** ".concat(i.keyConstraint,"."));let g=function(e){if(!e||0===e.length)return"";let t={door:"Door opening too narrow",floor_area:"Too small (floor space)",height:"Too tall for ceiling",payload:"Over weight limit",row_packing:"Items can't be arranged"};return["| Option | Result |","|--------|--------|",...e.map(e=>"| ".concat(e.name," | ").concat(e.fits?"✅ Fits":"❌ ".concat(t[e.reason]||"Too small")," |"))].join("\n")}(a);return g&&_.push("","**What I checked:**","",g),m?("door"===h&&_.push("","Large furniture is often **L-shaped or comes apart** — if your ".concat(d," does, measure the **largest rigid section** and try again; the ").concat(u," is usually the only blocker.")),o&&"HIGH"!==o&&_.push("","**For an exact answer:** share the ".concat(d,"'s actual width \xd7 depth \xd7 height — I sized this from an estimated footprint, so measure it to be sure."))):_.push("","vehicle"===t?"**Best option:** Split the load across multiple trucks or hire commercial freight.":"**Best option:** Consider splitting across multiple ".concat(l,"s.")),_.join("\n")}(e,t);if(!c||!_||!g)return i.U.warn("[RF-TRACE 5b] generateReverseFitResponse missing required fields — returning null:",JSON.stringify({hasRecommended:!!c,hasSummary:!!_,hasItemBreakdown:!!g})),null;let p=c.name.toUpperCase(),f=c.margin.floor_pct<15?" (tight fit)":"",w="**".concat(p,"**").concat(f," ✓"),v=_.totalItems,b=_.totalFloorPositions,y="".concat(v," item").concat(1===v?"":"s"," require").concat(1===v?"s":""," ~").concat(_.totalVolume_ft3.toLocaleString()," ft\xb3 and ").concat(b," floor position").concat(1===b?"":"s",".\n")+"A ".concat(c.name.toLowerCase()," is the smallest standard option that fits everything."),T="";if(u.length>0){let e=u.slice(-2).map(e=>{let t=function(e){switch(e.reason){case"floor_area":return"insufficient floor space";case"payload":return e.details||"exceeds payload limit";case"height":return"items too tall for ceiling";case"door":return"items too wide for door opening";case"row_packing":return e.details||"items cannot be arranged in rows";default:return e.details||"does not fit"}}(e);return"• ".concat(e.name,": ").concat(t)});T="**Why not smaller?**\n".concat(e.join("\n"))}let I=_.keyConstraint?"**Key constraint:** ".concat(_.keyConstraint):"",M=function(e){if(!e||0===e.length)return"";let t=e.map(e=>{let t;return"| ".concat((t=e.name).charAt(0).toUpperCase()+t.slice(1)," (").concat(e.dims,") | ").concat(e.qty," | ").concat(Math.round(e.volume_ft3/e.qty)," ft\xb3 | ").concat(e.volume_ft3," ft\xb3 | ").concat(e.floorPositions," (").concat(e.stackRule,") |")}),n=e.reduce((e,t)=>e+t.volume_ft3,0),i=e.reduce((e,t)=>e+t.floorPositions,0);return["| Item | Qty | Each | Total | Floor Positions |","|------|-----|------|-------|-----------------|",...t,"| **Total** | **".concat(e.reduce((e,t)=>e+t.qty,0),"** | | **").concat(n," ft\xb3** | **").concat(i,"** |")].join("\n")}(g),S="";if(d.length>0){let e=d.map(e=>e.name.toLowerCase()).join(", ");S="Also fits: ".concat(e)}let k=_.totalWeight_lbs>0?"Total weight: ".concat(_.totalWeight_lbs.toLocaleString()," lbs")+(null!=c.margin.payload_lbs?" (".concat(c.margin.payload_lbs.toLocaleString()," lbs under limit)"):""):"",N=[w,"",y];
1if(T&&N.push("",T),I&&N.push("",I),M&&N.push("",M),k&&N.push("",k),S&&N.push("",S),n){let i=function(e,t,n){if("RECOMMENDED"===t.verdict&&"RECOMMENDED"===e.verdict&&t.recommended.space===e.recommended.space)return"**REAL-WORLD CHECK** ✓\nThis recommendation holds with practical constraints applied (stacking limits, packing efficiency, loading clearance).";if("RECOMMENDED"===t.verdict){let n=h(e,t);return["**REAL-WORLD RECOMMENDATION**","A **".concat(t.recommended.name.toLowerCase(),"** is more realistic when accounting for:"),...n.map(e=>"• ".concat(e)),"","_The ".concat(e.recommended.name.toLowerCase()," is theoretically sufficient, but movers typically use the larger option to allow safe loading and securing._")].join("\n")}return"EXCEEDS_ALL"===t.verdict?["**REAL-WORLD RECOMMENDATION**","This load is theoretically possible in a single vehicle, but in practice requires **multiple trips or commercial freight**:",...h(e,t).map(e=>"• ".concat(e)),"","vehicle"===n?"_Consider two trucks or a 53-ft semi trailer for reliable transport._":"_Consider splitting across multiple units._"].join("\n"):null}(e,n,t);i&&N.push("","---","",i)}return N.join("\n")}function h(e,t){let n=[];return t.summary.totalFloorPositions>e.summary.totalFloorPositions&&n.push("Stacking limits increase floor positions from ".concat(e.summary.totalFloorPositions," to ").concat(t.summary.totalFloorPositions)),n.push("75% usable floor area (real-world packing, aisle space, wheel wells)"),t.summary.totalFloorPositions>e.summary.totalFloorPositions&&n.push("Heavy appliances kept upright and unstacked for safe transport"),n}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(null==e?void 0:e.queryType)==="slot_fit"?function(e){let{userUnit:t="in"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{verdict:n,slot_mm:a,assumptions:o=[]}=e;if(e.partialFit)return function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];let{partialFit:t,assumptions:n=[]}=e,a=(null==t?void 0:t.present)||[],o=(null==t?void 0:t.missing)||[],l=a.filter(e=>"DOESNT_FIT"!==e.verdict),s=o.length?o.join(" and "):"the remaining dimensions",m=[];if(null==t?void 0:t.decided){let e=a.filter(e=>"DOESNT_FIT"===e.verdict).reduce((e,t)=>t.margin<e.margin?t:e),t=g(Math.abs(e.margin));m.push("**DOESN'T FIT ✗** — Your item is too ".concat(_[e.axis]||"big"," for the opening: ")+"its ".concat(e.axis," is ").concat(g(e.itemDim),'" but the opening is only ').concat(g(e.slotDim),'" (short by ').concat(t,'").')),o.length&&m.push("No need for the ".concat(s," — it already won't fit on the ").concat(e.axis,"."))}else if(l.length){let e=l.map(e=>e.axis).join(" and "),t=l.map(e=>"".concat(g(Math.abs(e.margin)),'"')).join(" / ");m.push("**NEED A LITTLE MORE INFO** — Good news on the ".concat(e,": your item fits with about ").concat(t," to spare.")),m.push("To confirm the whole fit I still need the opening's ".concat(s,". Send ").concat(o.length>1?"those":"that"," and I'll finish the check."))}else m.push("**NEED A LITTLE MORE INFO** — I can't confirm the fit yet because I don't have the opening's ".concat(s,".")),m.push("Tell me the opening's ".concat(s," and I'll run the measurements."));for(let e of n)m.push("_".concat(e,"_"));return"1"===r.env.CLUSTER_E_DIAG&&i.U.warn("[CLUSTER-E-DIAG] renderer.PARTIAL_SLOT",JSON.stringify({decided:!!(null==t?void 0:t.decided),passing:l.map(e=>e.axis),missing:o})),{verdict:e.verdict,message:m.join("\n\n"),assumptions:n}}(e,t);if("UNKNOWN"===n){let t=Array.isArray(e.missing_slot_axes)&&e.missing_slot_axes.length?e.missing_slot_axes.join(" and "):"width and height",n=["**NEED A LITTLE MORE INFO** — I can't confirm the fit yet because I don't have the opening's ".concat(t,"."),"Tell me the slot's ".concat(t," and I'll run the measurements.")];for(let e of o)n.push("_".concat(e,"_"));return"1"===r.env.CLUSTER_E_DIAG&&i.U.warn("[CLUSTER-E-DIAG] renderer.SLOT_UNKNOWN_NEEDS_INFO",JSON.stringify({missing:e.missing_slot_axes||null,slot_mm:a})),{verdict:"UNKNOWN",message:n.join("\n\n"),assumptions:o}}if("inverse"===e.queryShape&&e.inverse)return function(e,t){let{slot_mm:n,assumptions:i=[],inverse:a}=e,{geometry:o,nominal:r}=a||{},l=(null==o?void 0:o.maxItemDims_mm)||{},s=g((null==n?void 0:n.width_mm)||0),m=g((null==n?void 0:n.height_mm)||0),c=(null==n?void 0:n.depth_mm)?g(n.depth_mm):null,d=c?"".concat(s,'" \xd7 ').concat(c,'" \xd7 ').concat(m,'"'):"".concat(s,'" \xd7 ').concat(m,'"'),h=g(l.width_mm||0),u=g(l.height_mm||0),_=null!=l.depth_mm?g(l.depth_mm):null,p=[];if(p.push("**Your ".concat(d," slot fits items up to ").concat(h,'" wide \xd7 ').concat(u,'" tall').concat(_?" \xd7 ".concat(_,'" deep'):"","** (after tolerances).")),(null==r?void 0:r.matchedSize)&&p.push("A standard **".concat(r.matchedSize,"** fits this slot.")),(null==r?void 0:r.note)&&p.push(r.note),i.length>0)for(let e of(p.push(""),i))p.push("_".concat(e,"_"));return{verdict:"INVERSE",message:p.join("\n\n"),assumptions:i,inverse:a}}(e,0);if("static_slot"===e.fit_mode&&e.perAxisMargins)return function(e,t){let{verdict:n,slot_mm:i,item_mm:a,perAxisMargins:o,usableSlot_mm:r,assumptions:l=[],r
1iskFactors:s=[]}=e,m=g((null==i?void 0:i.width_mm)||0),c=g((null==i?void 0:i.height_mm)||0),d=(null==i?void 0:i.depth_mm)?g(i.depth_mm):null,h=d?"".concat(m,'" \xd7 ').concat(d,'" \xd7 ').concat(c,'"'):"".concat(m,'" \xd7 ').concat(c,'"'),u=g((null==a?void 0:a.width_mm)||0),_=g((null==a?void 0:a.height_mm)||0),p=(null==a?void 0:a.depth_mm)?g(a.depth_mm):null,f=p?"".concat(u,'" \xd7 ').concat(p,'" \xd7 ').concat(_,'"'):"".concat(u,'" \xd7 ').concat(_,'"'),w=g((null==r?void 0:r.width_mm)||0),v=g((null==r?void 0:r.height_mm)||0),b=Math.min(o.width_mm,o.height_mm,o.depth_mm===1/0?o.width_mm:o.depth_mm),y=g(Math.abs(b)),T=b<0?"".concat(y,'" over, within measurement tolerance — measure both before committing'):"".concat(y,'"'),I=[];if(/^FITS/.test(n)||"LIKELY_FITS"===n){I.push("**".concat("FITS"===n?"FITS":n.replace(/_/g," ")," ✓** — Your ").concat(f," item fits in the ").concat(h," slot."));let e=Number.isFinite(null==r?void 0:r.width_mm),t=Number.isFinite(null==r?void 0:r.height_mm);if(e&&t)I.push("After tolerances, the usable slot is **".concat(w,'" \xd7 ').concat(v,'"** — tightest margin is **').concat(T,"**."));else if(e||t){let t=e?"".concat(w,'" wide'):"".concat(v,'" tall');I.push("After tolerances, the usable opening is **".concat(t,"** (the open face is unconstrained) — tightest margin is **").concat(T,"**."))}else I.push("Tightest margin after tolerances is **".concat(T,"**."))}else if("DOESNT_FIT"===n||"LIKELY_DOESNT_FIT"===n){I.push("DOESNT_FIT"===n?"**DOESN'T FIT ✗** — Your ".concat(f," item does not fit in the ").concat(h," slot."):"**LIKELY DOESN'T FIT ✗** — Your ".concat(f," item likely does not fit in the ").concat(h," slot. Some sizes were estimated, so measure before deciding."));let e=[];o.width_mm<0&&e.push("width (short by ".concat(g(Math.abs(o.width_mm)),'")')),o.height_mm<0&&e.push("height (short by ".concat(g(Math.abs(o.height_mm)),'")')),o.depth_mm!==1/0&&o.depth_mm<0&&e.push("depth (short by ".concat(g(Math.abs(o.depth_mm)),'")')),e.length>0&&I.push("Exceeds usable space on: ".concat(e.join(", "),"."))}else I.push("**".concat(n,"** — Cannot determine fit with available data."));if(l.length>0)for(let e of(I.push(""),l)){let t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.detail)?e.detail:null;t&&t.trim()&&I.push("_".concat(t,"_"))}return{verdict:n,message:I.join("\n\n"),assumptions:l}}(e,0);if("path_slot"===e.fit_mode){var l=e;let{assumptions:t=[],matched_cues:n=[],lowerBound:i}=l,a=[];if(a.push("**CANNOT DETERMINE** — This query involves installation-path geometry (".concat(n.join(", "),") that the solver cannot yet model.")),i&&/^FITS/.test(i.verdict)?a.push("**Best case (assuming no obstruction):** the item fits the slot with a static containment check."):i&&"DOESNT_FIT"===i.verdict&&a.push("**Even without the obstruction**, the item does not fit the slot on a static containment check."),t.length>0)for(let e of(a.push(""),t))a.push("_".concat(e,"_"));return{verdict:"UNKNOWN",message:a.join("\n\n"),assumptions:t}}let{recommended:s,alternatives:m=[],usableSlot_mm:c,catalog:d}=e,h=Math.round(((null==a?void 0:a.width_mm)||0)/25.4),u=Math.round(((null==a?void 0:a.height_mm)||0)/25.4),p=Math.round(((null==c?void 0:c.width_mm)||0)/25.4*10)/10,f=Math.round(((null==c?void 0:c.height_mm)||0)/25.4*10)/10,w=o.find(e=>/jamb|shim|allowance/i.test(e))||null;if("FITS"===n&&s){let e="**FITS ✓** — A ".concat(s.label," installs in your ").concat(h,'" \xd7 ').concat(u,'" ').concat((null==d?void 0:d.id)==="door_unit"?"rough opening":"slot","."),t=(null==d?void 0:d.displayName)?"With the ".concat(d.displayName.toLowerCase()," insertion allowance applied, your usable slot is **").concat(p,'" \xd7 ').concat(f,'"**.'):"After tolerances, your usable slot is **".concat(p,'" \xd7 ').concat(f,'"**.');return{verdict:n,message:[e,t,m.length>0?["Other standard options that fit:",...m.map(e=>"- ".concat(e.label))].join("\n"):"",w?"_".concat(w,"_"):""].filter(Boolean).join("\n\n"),recommended:s,alternatives:m,assumptions:o}}let v=(null==d?void 0:d.displayName)?"standard ".concat(d.displayName.toLowerCase()," entry"):"standard item";return{verdict:n,message:["**DOESN'T FIT** — No ".concat(v," installs in your ").concat(h,'" \xd7 ').concat(u,'" slot after tolerances.'),w?"_".concat(w,"_"):""].filter(
1Boolean).join("\n\n"),recommended:null,alternatives:[],assumptions:o}}(e,t):{verdict:(null==e?void 0:e.verdict)||"UNKNOWN",message:""}}let _={width:"wide",height:"tall",depth:"deep"};function g(e){return Math.round(e/25.4*10)/10}},58950:(e,t,n)=>{n.d(t,{Y:()=>I});var i=n(57132),a=n(89175);let o=["upright front-first","upright side-first","on side, front-first","on side, side-first","laid flat, depth across","laid flat, height across"],r=e=>["user_provided","measured","user_measured","user_parsed"].includes(e),l=(e,t)=>{var n,i;return null!=(i=null==e||null==(n=e._accessSources)?void 0:n[t])?i:null==e?void 0:e.dimensionSource},s=e=>null!=e&&(!Array.isArray(e)||e.length>0);var m=n(74737);let c=Number.isFinite,d=e=>c(e)&&e>0,h=(e,t,n)=>(t.x-e.x)*(n.z-e.z)-(t.z-e.z)*(n.x-e.x);function u(e,t,n){let i=[];for(let a=0;a<e.length;a++){let o=e[a],r=e[(a+1)%e.length],l=e=>n?e.x>=t:e.x<=t;l(o)&&i.push(o),l(o)!==l(r)&&i.push({x:t,z:o.z+(r.z-o.z)*(t-o.x)/(r.x-o.x)})}return i}var _=n(20514),g=n(76383),p=n(61890),f=n(11189),w=n(41154),v=n(27836),b=n(45263),y=n(27236),T=n(85850);function I(e,t){var n,I,M,S,k,N,x,E,D,F,C;let O,R=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=(0,w.Bz)(t),R=(0,w.w0)(t,R);let A=(0,w.fB)(t);if(A)return(0,f.Sp)(A,A.unknown_reason);let L=(0,i.w)(t,R);if("contradictory"===L.status){let e=(0,f.Sp)({regionCoverage:L,needs_user_input:L.needs_user_input},y.r.GENUINELY_UNDERSPECIFIED,L.needs_user_input.join("; "));return e.accessPathMeasurements=(0,v.df)(t,e,R),e}let P=(0,p.UK)(t,R);if(P.blocks){let e=(0,f.Sp)({stairConsistency:P,needs_user_input:P.needs_user_input},y.r.GENUINELY_UNDERSPECIFIED,"Stair measurements need clarification. "+P.needs_user_input.join("; "));return e.accessPathMeasurements=(0,v.df)(t,e,R),e}try{O=function(e,t){var n,i,o,r,l,s,c,d,h,u,v,I,M,S,k,N,x;let E,D=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},F=null!=(n=D.tolerance_mm)?n:m.KL.stairs,C=D.stairGrid||{};if(!e)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:F,confidence:"LOW",needs_user_input:["Item dimensions (width \xd7 depth \xd7 height)"]};let O=[e.width_mm,e.depth_mm,e.height_mm].filter(e=>Number.isFinite(e)&&e>0);if(O.length<3)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"insufficient_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:F,confidence:"LOW",needs_user_input:["Complete item dimensions"]};let R=D.calculationType;if("conservative_winder"===R){let n=function(e,t){var n,i,o,r,l,s,c;let d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=(0,w.Bz)({stairGeometry:t,_stairTypeConfig:d}),u=(0,w.fB)(h);if(u)return(0,f.Sp)(u,u.unknown_reason);if(Number.isFinite(h.stairGeometry.innerRadius_mm)&&Number.isFinite(h.stairGeometry.outerRadius_mm)&&h.stairGeometry.outerRadius_mm<=h.stairGeometry.innerRadius_mm)return(0,f.Sp)({needs_user_input:["Outer stair radius must exceed inner radius"]},y.r.MISSING_SPACE_DIMS);let g=(0,p.UK)(h);if(g.blocks)return(0,f.Sp)({stairConsistency:g,needs_user_input:g.needs_user_input},y.r.GENUINELY_UNDERSPECIFIED,"Stair measurements need clarification. "+g.needs_user_input.join("; "));let v=function(e,t){var n,i,o,r,l;let s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=null!=(n=c.tolerance_mm)?n:m.KL.stairs;if(!e)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:d,confidence:"LOW",search_space_exhausted:!0,method:"winder_geometry",warnings:[],details:{}};let h=[e.width_mm,e.depth_mm,e.height_mm].filter(e=>Number.isFinite(e)&&e>0);if(h.length<3)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"insufficient_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:d,confidence:"LOW",search_space_exhausted:!0,method:"winder_geometry",warnings:[],details:{}};let u=[],_=[],{innerRadius_mm:g,outerRadius_mm:p,turnAngle:w,winderSteps:v,headroom_mm:b,riser_mm:I,tread_mm:M}=t,S=2*Math.PI*g*(w/360)/v,k=2*Math.PI*p*(w/360)/v,N=p-g,x=(null!=(i=t.handrailCount)?i:2)*(null!=(o=t.handrailProtrusion_mm)?o:75),E=N-x-d,D=b-d,F=Math.atan2(I,M),C=Math.round(180*F/Math.PI),O=2*Math.PI*(g+E/2)*(w/360);if(u.push("Winder turn: ".concat(w,"\xb0 with ").concat(v," tapered treads")),u.push("Inner tread width: ".concat(Math.round(S),"mm, outer: ").concat(Math.round(k),"mm")),u.push("Effective radial width (rails and handling deducted): ".concat(Math.round(E),"mm")),u.push("Stair slope: ~".concat(C,"\xb0 (").concat(I,"mm rise / ").concat(M,"mm run)")),E<=0){let e=[...h].sort((e,t)=>
1e-t),t=e[0],n=e[e.length-1],i=e.length>=3?e[1]:null,a=Math.round(E-t),o=[{id:"theta_slope",passed:!0,values:{riser_mm:I,tread_mm:M,theta_slope_deg:C},limiting:!1},{id:"axis_inequality",passed:!1,values:{item_dim_mm:Math.round(t),space_dim_mm:Math.round(E),axis:"winder_width",margin_mm:a},comparison:{actual_mm:Math.round(t),limit_mm:Math.round(E),margin_mm:a},limiting:!0}],r=Math.sqrt(Math.max(0,E)**2+D**2);return o.push(...(0,T.kj)({itemFace:{a_mm:t,b_mm:n},spaceFace:{a_mm:Math.max(0,E),b_mm:D},itemReach:{l_mm:i,w_mm:t,h_mm:n},spaceReachDiag_mm:r,fits:!1})),o.push(...(0,T.Ew)({limitingAxis:"winder_width",itemDim_mm:t,spaceDim_mm:N-x,tolerance_mm:d,axisMargin_mm:a})),{verdict:"DOESNT_FIT",margin_mm:Math.round(E),limiting_constraint:"winder_width",checked_orientations:[],proofSteps:o,assumptions:u,tolerance_mm:d,confidence:"HIGH",search_space_exhausted:!0,method:"winder_geometry",warnings:["Effective width is zero or negative after tolerance deduction"],details:{innerTreadWidth_mm:Math.round(S),outerTreadWidth_mm:Math.round(k),effectiveWidth_mm:Math.round(E),headroom_mm:b,riser_mm:I,tread_mm:M,slope_deg:C,turnAngle:w,winderSteps:v,best_orientation:null,best_orientation_dims:null,stairGeometryAssumed:!1}}}let R=(0,f.vn)(function(e){let{width_mm:t,depth_mm:n,height_mm:i}=e,a=[t,n,i].filter(e=>null!=e);if(a.length<2)return[];if(2===a.length){let[e,t]=a.sort((e,t)=>e-t);return[{across:e,vertical:t,along:0,label:"portrait"},{across:t,vertical:e,along:0,label:"landscape"}]}return[{across:t,vertical:i,along:n,label:"upright front-first"},{across:n,vertical:i,along:t,label:"upright side-first"},{across:t,vertical:n,along:i,label:"on side, front-first"},{across:i,vertical:n,along:t,label:"on side, side-first"},{across:n,vertical:t,along:i,label:"laid flat, depth across"},{across:i,vertical:t,along:n,label:"laid flat, height across"}]}(e),c,e);if(!R.length)return(0,f.Sp)({needs_user_input:["Complete item dimensions and a supported carry orientation"]});let A=[];for(let e of R){let t={},n=!0,i=1/0,a=null,o=E-e.across;if(t.width={fits:o>=0,margin_mm:Math.round(o)},!t.width.fits&&(n=!1,o<i&&(i=o,a="winder_width")),e.along>0){let o=e.vertical+e.along*Math.sin((0,f.Wy)(c)?0:F),r=D-o;t.headroom={fits:r>=0,margin_mm:Math.round(r),sweptHeight_mm:Math.round(o)},!t.headroom.fits&&(n=!1,r<i&&(i=r,a="winder_headroom"))}else{let o=D-e.vertical;t.headroom={fits:o>=0,margin_mm:Math.round(o)},!t.headroom.fits&&(n=!1,o<i&&(i=o,a="winder_headroom"))}if(e.along>0){let o=O-e.along;t.sweptPath={fits:o>=0,margin_mm:Math.round(o)},!t.sweptPath.fits&&(n=!1,o<i&&(i=o,a="winder_swept_path"))}let r=[t.width.margin_mm,t.headroom.margin_mm];t.sweptPath&&r.push(t.sweptPath.margin_mm);let l=n?Math.min(...r):Math.round(i);A.push({orientation:e.label,dims:{across_mm:e.across,vertical_mm:e.vertical,along_mm:e.along},feasible:n,margin_mm:l,limitingConstraint:a||"winder_width",checks:t})}let L=A.filter(e=>e.feasible),P=L.length>0?L.reduce((e,t)=>t.margin_mm>e.margin_mm?t:e):A.reduce((e,t)=>t.margin_mm>e.margin_mm?t:e),U=P.margin_mm,H=P.limitingConstraint;("FITS_VERY_TIGHT"===(s=P.feasible?(0,a.K8)(P.margin_mm).verdict:"DOESNT_FIT")||"FITS_TIGHT"===s)&&_.push("Professional movers recommended for winder stair navigation with tight clearance");let W="DOESNT_FIT"!==s,G="winder_width"===P.limitingConstraint,q="winder_swept_path"===P.limitingConstraint,j="winder_headroom"===P.limitingConstraint,z=[{id:"theta_slope",passed:!0,values:{riser_mm:I,tread_mm:M,theta_slope_deg:C},limiting:!1},{id:"winder_path_len",passed:!P.checks.sweptPath||P.checks.sweptPath.fits,values:{r_inner_mm:Math.round(g),w_mm:Math.round(E),theta_turn_deg:w,path_len_mm:Math.round(O)},comparison:P.checks.sweptPath?{actual_mm:P.dims.along_mm,limit_mm:Math.round(O),margin_mm:P.checks.sweptPath.margin_mm}:void 0,limiting:q||j},{id:"axis_inequality",passed:!1!==P.checks.width.fits,values:{item_dim_mm:P.dims.across_mm,space_dim_mm:Math.round(E),axis:"winder_width",margin_mm:P.checks.width.margin_mm},comparison:{actual_mm:P.dims.across_mm,limit_mm:Math.round(E),margin_mm:P.checks.width.margin_mm},limiting:G}];if(z.some(e=>!0===e.limiting)){if(z.filter(e=>!0===e.limiting).length>1){let e=!1;for(let t of z)t.limiting&&(e?t.limiting=!1:e=!0)}}else{let e=z.find(e=>"axis_inequality"===e.id);e&&(e.limiting=!0)}{let e=Math.sqrt(E**2+D**2);z.push(...(0,T.kj)({itemFace:{a_mm:P.dims.across_mm,b_mm:P.dims.vertical_mm},spaceFace:{a_mm:E,b_mm:D},itemReach:{l_mm:P.dims.along_mm,w_mm:P.dims.across_mm,h_mm:P.dims.vertical_mm},spaceReachDiag_mm:e,fits:W}))}return W||z.push(...(0,T.Ew)({limitingAxis:"winder_width",itemDim_mm:P.dims.across_mm,spaceDim_mm:N-x,tolerance_mm:d,axisMargin_mm:null==(l=P.checks)||null==(r=l.width)?void 0:r.margin_mm})),{verdict:s,margin_mm:Math.round(U),limiting_constraint:H,checked_orientations:A.map(e=>{var t,n,i,a,o,r;return{orientation:e.orientation,feasible:e.feasible,margin_mm:e.margin_mm,dims:e.dims,checks:e.checks,width_clearance_mm:null!=(o=null==(n=e.checks)||null==(t=n.width)?void 0:t.margin_mm)?o:null,height_clearance_mm:null!=(r=null==(a=e.checks)||null==(i=a.headroom)?void 0:i.margin_mm)?r:null,limitingConstraint:e.limitingConstraint||null}}),proofSteps:z,orientationRationale:A.length>1?"Best orientation chosen because its annular-path length (Step 2) clears with the largest margin among all six orientations.":null,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{effective_width_mm:Math.round(E),headroom_mm:b,inner_radius_mm:Math.round(g)},assumptions:u,tolerance_mm:d,confidence:"HIGH",search_space_exhausted:!0,method:"winder_geometry",warnings:_,details:{innerTreadWidth_mm:Math.round(S),outerTreadWidth_mm:Math.round(k),effectiveWidth_mm:Math.round(E),innerRadius_mm:Math.round(g),outerRadius_mm:Math.round(p),headroom_mm:b,riser_mm:I,tread_mm:M,slope_deg:C,turnAngle:w,winderSteps:v,best_orientation:P.orientation,best_orientation_dims:P.dims,stairGeometryAssumed:!1,stairTypeName:c.stairTypeName||c.stairTypeId||void 0,numberOfRisers:c.numberOfRisers||void 0,totalRise_mm:c.totalRise_mm||void 0,turnType:c.turnType||"winder",turnDirection:c.turnDirection||void 0,navigationComplexity:c.navigationComplexity||void 0}}}(e,h.stairGeometry,d);v.stairConsistency=g;let b=h.stairGeometry.outerRadius_mm-h.stairGeometry.innerRadius_mm,I=(null!=(o=h.stairGeometry.handrailCount)?o:2)*(null!=(r=h.stairGeometry.handrailProtrusion_mm)?r:75);v.specialStairCheck={version:"special-stair-bounds/1",scope:"approximate_turn_bounds_only",radial_width_mm:b,rail_deduction_mm:I,usable_width_mm:Math.min(b,null!=(l=h.stairGeometry.effectiveWidth_mm)?l:b)-I-(null!=(s=d.tolerance_mm)?s:m.KL.stairs),nosing_status:"recorded_but_not_evaluated",headroom_status:"measurement_direction_and_profile_unestablished",entry_exit_proven:!1,continuous_path_proven:!1,approximation:"Arc length and step chord are diagnostic proxies, not a continuous rigid-body sweep or a universal item-length limit.",assumptions:null!=(c=v.assumptions)?c:[]};let M=h.stairGeometry,S=(null==M?void 0:M.outerRadius_mm)-(null==M?void 0:M.innerRadius_mm),k=[null==M||null==(n=M._accessSources)?void 0:n.innerRadius,null==M||null==(i=M._accessSources)?void 0:i.outerRadius],N=(0,_.CE)(e,S,k);
1return(0,f.JU)((0,_.to)(v,N,void 0,(0,_.IX)(e,S,k)),d)}(e,(0,g.Yp)(t,R),D),i=(null==t?void 0:t._stairGeometrySources)||{},o=n.obstruction_proven?[]:["user_provided"!==i.innerRadius&&"Inner turn radius","user_provided"!==i.headroom&&"Headroom through the turn","user_provided"!==i.width&&"Narrowest clear width"].filter(Boolean);return{...n,selected_topology:D.stairTypeId||null,calculation_type:R,solver_identity:"winder_geometry",support_category:"conservative_bound",capability_limitations:["Checks conservative width, headroom, and annular turn bounds; it does not prove a continuous carry path.",...o.length>0?["Turn geometry includes standard-type defaults rather than a complete measured route."]:[]],decisive_measurements_missing:o,needs_user_input:[...new Set([...n.needs_user_input||[],...o])],stair_measurement_sources:i}}if("conservative_spiral"===R)return function(e,t){var n,i,o,r,l,s,c;let d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=(0,w.Bz)({stairGeometry:t,_stairTypeConfig:d}),u=(0,w.fB)(h);if(u)return(0,f.Sp)(u,u.unknown_reason);if(Number.isFinite(h.stairGeometry.innerRadius_mm)&&Number.isFinite(h.stairGeometry.outerRadius_mm)&&h.stairGeometry.outerRadius_mm<=h.stairGeometry.innerRadius_mm)return(0,f.Sp)({needs_user_input:["Outer stair radius must exceed inner radius"]},y.r.MISSING_SPACE_DIMS);let v=(0,p.UK)(h);if(v.blocks)return(0,f.Sp)({stairConsistency:v,needs_user_input:v.needs_user_input},y.r.GENUINELY_UNDERSPECIFIED,"Stair measurements need clarification. "+v.needs_user_input.join("; "));let b=function(e,t){var n,i,o,r,l;let s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=null!=(n=c.tolerance_mm)?n:m.KL.stairs;if(!e)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:d,confidence:"LOW",search_space_exhausted:!0,method:"spiral_geometry",warnings:[],details:{}};if([e.width_mm,e.depth_mm,e.height_mm].filter(e=>Number.isFinite(e)&&e>0).length<3)return{verdict:"UNKNOWN",unknown_reason:y.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"insufficient_item_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:d,confidence:"LOW",search_space_exhausted:!0,method:"spiral_geometry",warnings:[],details:{}};let h=[],u=[],{innerRadius_mm:_,outerRadius_mm:p,effectiveWidth_mm:w,turnAngle:v,headroom_mm:b,riser_mm:I,tread_mm:M,stepsPerRevolution:S}=t,k=(_+p)/2,N=2*Math.PI/S,x=2*k*Math.sin(N/2),E=(null!=(i=t.handrailCount)?i:2)*(null!=(o=t.handrailProtrusion_mm)?o:75),D=Math.min(w,p-_),F=D-E-d,C=Math.atan2(I,M),O=Math.round(180*C/Math.PI),R=Math.min(b,I*S-g.DP);h.push("Walking radius: ".concat(Math.round(k),"mm (midpoint of annular path)")),h.push("Max chord between steps: ".concat(Math.round(x),"mm at walking radius")),h.push("Stair slope: ~".concat(O,"\xb0 (").concat(I,"mm rise / ").concat(M,"mm run)"));let A=(0,f.vn)(function(e){let{width_mm:t,depth_mm:n,height_mm:i}=e,a=[t,n,i].filter(e=>null!=e);if(a.length<2)return[];if(2===a.length){let[e,t]=a.sort((e,t)=>e-t);return[{across:e,vertical:t,along:0,label:"portrait"},{across:t,vertical:e,along:0,label:"landscape"}]}return[{across:t,vertical:i,along:n,label:"upright front-first"},{across:n,vertical:i,along:t,label:"upright side-first"},{across:t,vertical:n,along:i,label:"on side, front-first"},{across:i,vertical:n,along:t,label:"on side, side-first"},{across:n,vertical:t,along:i,label:"laid flat, depth across"},{across:i,vertical:t,along:n,label:"laid flat, height across"}]}(e),c,e);if(!A.length)return(0,f.Sp)({needs_user_input:["Complete item dimensions and a supported carry orientation"]});let L=[];for(let e of A){let t,n={},i=!0,a=1/0,o=null,r=F-e.across;if(n.width={fits:r>=0,margin_mm:Math.round(r)},!n.width.fits&&(i=!1,r<a&&(a=r,o="radial_width")),e.along>0){let n=(0,f.Wy)(c)?0:C;t=R-(e.vertical*Math.cos(n)+e.along*Math.sin(n))}else t=R-e.vertical;if(n.headroom={fits:t>=0,margin_mm:Math.round(t)},!n.headroom.fits&&(i=!1,t<a&&(a=t,o="vertical_headroom")),e.along>0){let t=x-e.along;n.chord={fits:t>=0,margin_mm:Math.round(t)},!n.chord.fits&&(i=!1,t<a&&(a=t,o="chord_path"))}let l=F-e.across,s=b-e.vertical,m=Math.min(l,s);n.entry={fits:m>=0,margin_mm:Math.round(m)},!n.entry.fits&&(i=!1,m<a&&(a=m,o=s<l?"entry_vertical_clearance":"entry_clearance"));let d=[n.width.margin_mm,n.headroom.margin_mm];n.chord&&d.push(n.chord.margin_mm),d.push(n.entry.margin_mm);let h=i?Math.min(...d):Math.round(a);L.push({orientation:e.label,dims:{across_mm:e.across,vertical_mm:e.vertical,along_mm:e.along},feasible:i,margin_mm:h,limitingConstraint:o||"radial_width",checks:n})}let P=L.filter(e=>e.feasible),U=P.length>0?P.reduce((e,t)=>
1t.margin_mm>e.margin_mm?t:e):L.reduce((e,t)=>t.margin_mm>e.margin_mm?t:e),H=U.margin_mm,W=U.limitingConstraint;("FITS_VERY_TIGHT"===(s=U.feasible?(0,a.K8)(U.margin_mm).verdict:"DOESNT_FIT")||"FITS_TIGHT"===s)&&u.push("Professional movers recommended for spiral stair navigation with tight clearance");let G="DOESNT_FIT"!==s,q="chord_path"===U.limitingConstraint,j=Math.round(180/Math.PI*N*10)/10,z=[{id:"spiral_max_chord",passed:!U.checks.chord||U.checks.chord.fits,values:{r_inner_mm:Math.round(_),r_outer_mm:Math.round(p),delta_phi_deg:j,max_chord_mm:Math.round(x)},comparison:U.checks.chord?{actual_mm:U.dims.along_mm,limit_mm:Math.round(x),margin_mm:U.checks.chord.margin_mm}:void 0,limiting:q},{id:"axis_inequality",passed:!1!==U.checks.width.fits,values:{item_dim_mm:U.dims.across_mm,space_dim_mm:Math.round(F),axis:"radial_width",margin_mm:U.checks.width.margin_mm},comparison:{actual_mm:U.dims.across_mm,limit_mm:Math.round(F),margin_mm:U.checks.width.margin_mm},limiting:!q}],V=z.filter(e=>!0===e.limiting).length;if(0===V)z[z.length-1].limiting=!0;else if(V>1){let e=!1;for(let t of z)t.limiting&&(e?t.limiting=!1:e=!0)}{let e=Math.sqrt(Math.max(0,F)**2+R**2);z.push(...(0,T.kj)({itemFace:{a_mm:U.dims.across_mm,b_mm:U.dims.vertical_mm},spaceFace:{a_mm:Math.max(0,F),b_mm:R},itemReach:{l_mm:U.dims.along_mm,w_mm:U.dims.across_mm,h_mm:U.dims.vertical_mm},spaceReachDiag_mm:e,fits:G}))}return G||z.push(...(0,T.Ew)({limitingAxis:"radial_width",itemDim_mm:U.dims.across_mm,spaceDim_mm:D-E,tolerance_mm:d,axisMargin_mm:null==(l=U.checks)||null==(r=l.width)?void 0:r.margin_mm})),{verdict:s,margin_mm:Math.round(H),limiting_constraint:W,checked_orientations:L.map(e=>{var t,n,i,a,o,r;return{orientation:e.orientation,feasible:e.feasible,margin_mm:e.margin_mm,dims:e.dims,checks:e.checks,width_clearance_mm:null!=(o=null==(n=e.checks)||null==(t=n.width)?void 0:t.margin_mm)?o:null,height_clearance_mm:null!=(r=null==(a=e.checks)||null==(i=a.headroom)?void 0:i.margin_mm)?r:null,limitingConstraint:e.limitingConstraint||null}}),proofSteps:z,orientationRationale:L.length>1?"Best orientation chosen because its max-chord clearance (Step 1) is the largest among all six orientations.":null,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{effective_width_mm:Math.round(F),headroom_mm:b,walking_radius_mm:Math.round(k)},assumptions:h,tolerance_mm:d,confidence:"HIGH",search_space_exhausted:!0,method:"spiral_geometry",warnings:u,details:{effectiveWidth_mm:w,headroom_mm:b,riser_mm:I,tread_mm:M,slope_deg:O,walkingRadius_mm:Math.round(k),maxChordLength_mm:Math.round(x),turnAngle:v,stepsPerRevolution:S,innerRadius_mm:_,outerRadius_mm:p,diameter_mm:p?Math.round(2*p):void 0,best_orientation:U.orientation,best_orientation_dims:U.dims,stairGeometryAssumed:!1,stairTypeName:c.stairTypeName||c.stairTypeId||void 0,numberOfRisers:c.numberOfRisers||void 0,totalRise_mm:c.totalRise_mm||void 0,totalRotation:c.totalRotation||v,turnDirection:c.turnDirection||void 0,navigationComplexity:c.navigationComplexity||void 0}}}(e,h.stairGeometry,d);b.stairConsistency=v;let I=h.stairGeometry.outerRadius_mm-h.stairGeometry.innerRadius_mm,M=(null!=(o=h.stairGeometry.handrailCount)?o:2)*(null!=(r=h.stairGeometry.handrailProtrusion_mm)?r:75);b.specialStairCheck={version:"special-stair-bounds/1",scope:"approximate_turn_bounds_only",radial_width_mm:I,rail_deduction_mm:M,usable_width_mm:Math.min(I,null!=(l=h.stairGeometry.effectiveWidth_mm)?l:I)-M-(null!=(s=d.tolerance_mm)?s:m.KL.stairs),nosing_status:"recorded_but_not_evaluated",headroom_status:"measurement_direction_and_profile_unestablished",entry_exit_proven:!1,continuous_path_proven:!1,approximation:"Arc length and step chord are diagnostic proxies, not a continuous rigid-body sweep or a universal item-length limit.",assumptions:null!=(c=b.assumptions)?c:[]};let S=h.stairGeometry,k=(null==S?void 0:S.outerRadius_mm)-(null==S?void 0:S.innerRadius_mm),N=[null==S||null==(n=S._accessSources)?void 0:n.innerRadius,null==S||null==(i=S._accessSources)?void 0:i.outerRadius],x=(0,_.CE)(e,k,N);return(0,f.JU)((0,_.to)(b,x,void 0,(0,_.IX)(e,k,N)),d)}(e,(0,g.Yp)(t,R),D);let A=[],L=[],P=(null==t?void 0:t.stairGeometry)||{},U=!1,H=(null==t?void 0:t.width_mm)||C.width_mm;H||(H=m.aA.stairs.width_mm,A.push('Using standard stair width: 36" ('.concat(H,"mm)")));let W=P.riser_mm||g.jn.riser_mm,G=P.tread_mm||g.jn.tread_mm,q=P.headroom_mm||g.jn.headroom_mm,j=null!=(i=P.nosing_mm)?
1i:g.jn.nosing_mm,z=Number.isFinite(P.handrailProtrusion_mm)?P.handrailProtrusion_mm:g.jn.handrail_mm,V=Number.isFinite(P.handrailCount)?P.handrailCount:2;P.riser_mm||P.tread_mm||P.headroom_mm||(U=!0);let B=H-V*z,Y=B-F,K=G-j,$=Math.atan2(W,G),X=Math.round(180*$/Math.PI);if(Y<=0){let e=Math.min(...O),t=[...O].sort((e,t)=>e-t),n=t[0],i=t[t.length-1],a=t.length>=3?t[1]:null,o=Math.round(Y-e),r=[{id:"theta_slope",passed:!0,values:{riser_mm:W,tread_mm:G,theta_slope_deg:X},limiting:!1},{id:"axis_inequality",passed:!1,values:{item_dim_mm:Math.round(n),space_dim_mm:Math.round(Y),axis:"stair_width",margin_mm:o},comparison:{actual_mm:Math.round(n),limit_mm:Math.round(Y),margin_mm:o},limiting:!0}],l=Math.sqrt(Math.max(0,Y)**2+q**2);return r.push(...(0,T.kj)({itemFace:{a_mm:n,b_mm:i},spaceFace:{a_mm:Math.max(0,Y),b_mm:q},itemReach:{l_mm:a,w_mm:n,h_mm:i},spaceReachDiag_mm:l,fits:!1})),r.push(...(0,T.Ew)({limitingAxis:"stair_width",itemDim_mm:n,spaceDim_mm:B,tolerance_mm:F,axisMargin_mm:o})),{verdict:"DOESNT_FIT",margin_mm:Math.round(Y),limiting_constraint:"stair_width",checked_orientations:[],proofSteps:r,assumptions:A,tolerance_mm:F,confidence:"LOW",warnings:["Effective stair width is zero or negative after handrail deduction"]}}let Q=(0,f.vn)(function(e){let{width_mm:t,depth_mm:n,height_mm:i}=e,a=[t,n,i].filter(e=>null!=e);if(a.length<2)return[];if(2===a.length){let[e,t]=a.sort((e,t)=>e-t);return[{across:e,vertical:t,along:0,label:"portrait"},{across:t,vertical:e,along:0,label:"landscape"}]}return[{across:t,vertical:i,along:n,label:"upright front-first"},{across:n,vertical:i,along:t,label:"upright side-first"},{across:t,vertical:n,along:i,label:"on side, front-first"},{across:i,vertical:n,along:t,label:"on side, side-first"},{across:n,vertical:t,along:i,label:"laid flat, depth across"},{across:i,vertical:t,along:n,label:"laid flat, height across"}]}(e),D,e);if(!Q.length)return(0,f.Sp)({needs_user_input:["Complete item dimensions and a supported carry orientation"]});let J=[];for(let e of Q){let t,n={},i=!0,a=1/0,o=null,r=Y-e.across;if(n.width={fits:r>=0,margin_mm:Math.round(r)},!n.width.fits&&(i=!1,r<a&&(a=r,o="stair_width")),e.along>0){let t=function(e,t,n,i){let a=e*Math.cos(i)+t*Math.sin(i),o=n-a;return{fits:o>=0,margin_mm:Math.round(o),sweptHeight_mm:Math.round(a)}}(e.vertical,e.along,q,(0,f.Wy)(D)?0:$);n.headroom=t,!t.fits&&(i=!1,t.margin_mm<a&&(a=t.margin_mm,o="stair_headroom"))}else{let t=q-e.vertical;n.headroom={fits:t>=0,margin_mm:Math.round(t)},!n.headroom.fits&&(i=!1,t<a&&(a=t,o="stair_headroom"))}if(i){let e=n.width.margin_mm,i=n.headroom.margin_mm;i<e?(t=i,o="stair_headroom"):(t=e,o="stair_width")}else t=Math.round(a);J.push({orientation:e.label,dims:{across_mm:e.across,vertical_mm:e.vertical,along_mm:e.along},feasible:i,margin_mm:t,limitingConstraint:o||"stair_width",checks:n})}let Z=null,ee=null!=P.turn_count?P.turn_count>0:(null==t?void 0:t.has_turn)||C.hasTurn||P.hasLanding;if(ee&&3===O.length){let n={...t,width_mm:null!=(o=P.incoming_width_mm)?o:H,width_after_mm:null!=(r=P.outgoing_width_mm)?r:H,height_mm:q,has_turn:!0,turn_angle:null!=(l=null==t?void 0:t.turn_angle)?l:90,landing_w_mm:null!=(s=P.landing_width_mm)?s:H,landing_d_mm:null!=(c=P.landing_depth_mm)?c:g.jn.landing_depth_mm,incoming_rail_deduction_mm:null!=(d=P.incoming_rail_deduction_mm)?d:V*z,outgoing_rail_deduction_mm:null!=(h=P.outgoing_rail_deduction_mm)?h:V*z,landing_rail_width_mm:P.landing_rail_width_mm,landing_rail_depth_mm:P.landing_rail_depth_mm,obstacles:null!=(u=P.obstacles)?u:t.obstacles,rails:null!=(v=P.rails)?v:t.rails,landingInputSources:{incoming:null==P.incoming_width_mm?"stair_width":"provided",outgoing:null==P.outgoing_width_mm?"assumed_equal_stair_width":"provided",width:null==P.landing_width_mm?"assumed_stair_width":"provided",depth:null==P.landing_depth_mm?"assumed_standard":"provided"}};try{Z=(0,b.FT)(e,n,{...D,tolerance_mm:F})}catch(e){Z={verdict:"UNKNOWN",unknown_reason:y.r.OTHER,failed:!0,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT"}}"DOESNT_FIT"===Z.verdict&&L.push("Item fits on straight stairs but cannot navigate the landing turn")}let et=J.filter(e=>e.feasible),en=et.length>0?et.reduce((e,t)=>
1t.margin_mm>e.margin_mm?t:e):J.reduce((e,t)=>t.margin_mm>e.margin_mm?t:e),ei=en.margin_mm,ea=en.limitingConstraint,eo=U?"MEDIUM":"HIGH";if(ee&&Z)if("DOESNT_FIT"===Z.verdict&&en.feasible)ei=Z.margin_mm,E="DOESNT_FIT",ea="landing_turn";else if("UNKNOWN"===Z.verdict)en.feasible?(E="UNKNOWN",ei=null,ea="landing_turn",L.push("Landing turn geometry could not be fully analyzed"),eo="LOW"):E="DOESNT_FIT";else{let e=Z.margin_mm;e<ei&&(ei=e,ea="landing_turn"),E=(0,a.K8)(ei).verdict}else E=en.feasible?(0,a.K8)(en.margin_mm).verdict:"DOESNT_FIT";let er=e=>Math.round(e/25.4*10)/10,el=er(W),es=er(G),em=er(q),ec=er(z),ed=er(j);U&&A.push("Standard stair geometry assumed: ".concat(el,'" riser, ').concat(es,'" tread, ').concat(em,'" headroom')),0===V?A.push("No handrails — full stair width available (handrail allowance reclaimed)"):A.push("Handrail protrusion: ".concat(ec,'" per side \xd7 ').concat(V," (").concat(er(V*z),'" total)')),A.push("Stair slope: ~".concat(X,"\xb0 (").concat(el,'" rise / ').concat(es,'" run)')),j>0&&A.push("Tread nosing overhang: ".concat(ed,'" recorded with tread depth; not a carried-item resting constraint')),P.isSpiral&&(L.push("Spiral stairs have highly constrained geometry — this solver models straight/L-shaped stairs only"),eo="LOW"),("FITS_VERY_TIGHT"===E||"FITS_TIGHT"===E)&&L.push("Professional movers recommended for stair navigation with tight clearance");let eh="DOESNT_FIT"!==E,eu=[{id:"theta_slope",passed:!0,values:{riser_mm:W,tread_mm:G,theta_slope_deg:X},limiting:!1}],e_="stair_headroom"===en.limitingConstraint||"stair_diagonal_length"===en.limitingConstraint||"landing_turn"===en.limitingConstraint;if(en.dims.along_mm>0&&en.checks.headroom&&eu.push({id:"eff_height_tilted",passed:!1!==en.checks.headroom.fits,values:{vert_mm:en.dims.vertical_mm,along_mm:en.dims.along_mm,theta_deg:(0,f.Wy)(D)?0:X,eff_height_mm:null!=(I=en.checks.headroom.sweptHeight_mm)?I:Math.round(en.dims.vertical_mm*Math.cos($)+en.dims.along_mm*Math.sin($))},comparison:{actual_mm:null!=(M=en.checks.headroom.sweptHeight_mm)?M:Math.round(en.dims.vertical_mm*Math.cos($)+en.dims.along_mm*Math.sin($)),limit_mm:q,margin_mm:en.checks.headroom.margin_mm},limiting:e_}),eu.push({id:"axis_inequality",passed:!1!==en.checks.width.fits,values:{item_dim_mm:en.dims.across_mm,space_dim_mm:Y,axis:"stair_width",margin_mm:en.checks.width.margin_mm},comparison:{actual_mm:en.dims.across_mm,limit_mm:Y,margin_mm:en.checks.width.margin_mm},limiting:!e_}),!eu.some(e=>!0===e.limiting)){let e=eu.find(e=>"axis_inequality"===e.id);e&&(e.limiting=!0)}if(!eh){let e=e_&&en.dims.along_mm>0;eu.push(...(0,T.Ew)({limitingAxis:e?"stair_headroom":"stair_width",itemDim_mm:e?null!=(x=null==(S=en.checks.headroom)?void 0:S.sweptHeight_mm)?x:Math.round(en.dims.vertical_mm*Math.cos($)+en.dims.along_mm*Math.sin($)):en.dims.across_mm,spaceDim_mm:e?q:B,tolerance_mm:F,axisMargin_mm:e?null==(k=en.checks.headroom)?void 0:k.margin_mm:null==(N=en.checks.width)?void 0:N.margin_mm}))}return{verdict:E,...(null==Z?void 0:Z.landingCheck)?{landingCheck:Z.landingCheck}:{},unknown_reason:"UNKNOWN"===E?null==Z?void 0:Z.unknown_reason:void 0,...(null==Z?void 0:Z.failed)&&"UNKNOWN"===E?{failed:!0}:{},needs_user_input:"UNKNOWN"===E?(null==Z?void 0:Z.needs_user_input)||["Supported landing geometry for the required turn"]:[],margin_mm:null==ei?null:Math.round(ei),obstruction_proven:(null==Z?void 0:Z.obstruction_proven)||J.every(e=>e.dims.across_mm>B)&&Math.min(...O)>H&&Number.isFinite(t.width_mm),limiting_constraint:ea,checked_orientations:J.map(e=>{var t,n,i,a,o,r;return{orientation:e.orientation,feasible:e.feasible,margin_mm:e.margin_mm,dims:e.dims,checks:e.checks,width_clearance_mm:null!=(o=null==(n=e.checks)||null==(t=n.width)?void 0:t.margin_mm)?o:null,height_clearance_mm:null!=(r=null==(a=e.checks)||null==(i=a.headroom)?void 0:i.margin_mm)?r:null,limitingConstraint:e.limitingConstraint||null}}),proofSteps:eu,orientationRationale:J.length>1?"Best orientation chosen because its tilted-carry envelope (Step 2) and width check (Step 3) clear with the largest combined margin.":null,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{stair_width_mm:H,headroom_mm:q,effective_width_mm:Y},assumptions:A,tolerance_mm:F,confidence:eo,search_space_exhausted:!0,method:ee?"full_geometry_with_turn":"full_geometry",_landingTurn:ee&&Z&&"landing_turn"===ea&&Array.isArray(Z.checked_orientations)&&Z.checked_orientations.length?{method:Z.method,checked_orientations:Z.checked_orientations,turnSpace:{width_mm:Y,height_mm:q}}:void 0,warnings:L,details:{stair_width_mm:H,rail_adjusted_width_mm:B,effective_width_mm:Y,headroom_mm:q,riser_mm:W,tread_mm:G,effective_tread_mm:K,nosing_mm:j,slope_deg:X,best_orientation:en.orientation,best_orientation_dims:en.dims,landingTurnResult:Z,stairGeometryAssumed:U,stairTypeName:D.stairTypeName||D.stairTypeId||void 0,numberOfRisers:D.numberOfRisers||void 0,totalRise_mm:D.totalRise_mm||void 0,totalRun_mm:D.totalRun_mm||void 0,landing_width_mm:ee?P.landing_width_mm||H:null,landing_depth_mm:ee?P.landing_depth_mm||g.jn.landing_depth_mm:null,landingSize_mm:D.landingSize_mm||ee&&P.landing_width_mm||void 0,turnAngle:ee?(null==t?void 0:t.turn_angle)||90:void 0,turnType:D.turnType||void 0,turnDirection:D.turnDirection||void 0,totalRotation:D.totalRotation||void 0,navigationComplexity:D.navigationComplexity||void 0,handrailCount:V,handrailProtrusion_mm:z,handrailRefinement:(null==t?void 0:t._handrailRefinement)||null}}}(e,t,R)}catch(e){return(0,f.Sp)({failed:!0},y.r.OTHER,"A required stair check failed; passage has not been established.")}let U=null==(n=O.details)?void 0:n.landingTurnResult;(null==U?void 0:U.obstruction_proven)&&(O={...O,...U,details:{...O.details,best_orientation:null,best_orientation_dims:null},assumptions:[...O.assumptions||[],...U.assumptions||[]]}),O.stairConsistency=P,O.regionCoverage=L,O.accessPathMeasurements=(0,v.df)(t,O,R),(null==t||null==(I=t.stairGeometry)?void 0:I.turn_count)>1&&/^FITS/.test(O.verdict||"")&&(O.verdict="UNKNOWN",O.unknown_reason=y.r.GENUINELY_UNDERSPECIFIED,O.margin_mm=null,O.margin_unknown_reason="MARGIN_MISSING_REQUIRED_INPUT",O.confidence="LOW",O.tightestPoint=null,O.pipeline_complete=!1,O.needs_user_input=[...O.needs_user_input||[],"Width, depth, headroom and turn angle for each stair landing"],O.message="Multiple stair turns were supplied. One landing check does not establish clearance at every turn; provide the geometry of each landing.");let H=["conservative_winder","conservative_spiral"].includes(R.calculationType),W=H?null:function(e,t){var n,i,a,o,_,g,p,f,w,v,b;let y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},T=null!=(i=null==t?void 0:t.stairGeometry)?i:{},I=T.flightModel,M={version:"ordinary-flight-envelope/2",scope:"declared_flight_interior_only",status:"not_evaluated",continuous_path_proven:!1,entry_exit_proven:!1,needs_user_input:[],candidates:[],inputs:null!=I?I:null,limitations:["Fixed-pitch translation over a continuous upper floor envelope only.","Entry, exit, pitch transitions, adjoining regions and human handling are unproved.","A missed candidate is not proof of impossibility; alternate carries have not been searched."]},S=e=>M.needs_user_input.push(e);if(!I||"object"!=typeof I||Array.isArray(I))return S("Declare the headroom direction, ceiling profile, floor envelope and carry pitch for this flight"),M;for(let n of("nosing_envelope"!==I.floorProfile&&S("Declare a continuous upper nosing envelope as the floor profile"),["parallel","horizontal"].includes(I.ceilingProfile)||S("Declare parallel or horizontal ceiling geometry"),["vertical","perpendicular"].includes(I.headroomDirection)||S("Declare vertical or perpendicular headroom"),"horizontal"===I.ceilingProfile&&"vertical"!==I.headroomDirection&&S("Horizontal ceiling height must be vertical at x=0"),d(T.riser_mm)&&d(T.tread_mm)&&d(T.headroom_mm)||S("Provide measured riser, tread and headroom"),d(null==t?void 0:t.width_mm)||S("Provide stair width"),[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.he
1ight_mm].every(d)||S("Provide all three item dimensions"),(!c(I.pitch_deg)||Math.abs(I.pitch_deg)>90)&&S("Provide a fixed world pitch between -90 and 90 degrees"),d(I.travel_mm)||S("Provide horizontal center travel for this flight in mm"),["entry","exit"]))"unproved"!==I[n]&&(!I[n]||"object"!=typeof I[n]||Array.isArray(I[n]))&&S("Declare measured "+n+" pose or retain it as unproved");for(let e of["allowTilt","allowYaw"])null!=y[e]&&"boolean"!=typeof y[e]&&S("Correct the "+e+" carry restriction");null!=y.maxPitch_deg&&(!c(y.maxPitch_deg)||y.maxPitch_deg<0||y.maxPitch_deg>90)&&S("Correct the maximum carry pitch"),((!1===y.allowTilt||"upright"===y.orientationConstraint)&&0!==I.pitch_deg||null!=y.maxPitch_deg&&Math.abs(I.pitch_deg)>y.maxPitch_deg)&&S("The declared pitch violates the retained carry restriction");let k=null!=(a=y.tolerance_mm)?a:m.KL.stairs;for(let e of((!c(k)||k<0)&&S("Provide a nonnegative handling clearance"),["riser","tread","headroom"]))/assumed|default/.test(null!=(o=null==(n=T._accessSources)?void 0:n[e])?o:"")&&S("Provide measured "+e+" for the declared flight");(!Number.isInteger(null!=(_=T.handrailCount)?_:2)||(null!=(g=T.handrailCount)?g:2)<0||!c(null!=(p=T.handrailProtrusion_mm)?p:75)||(null!=(f=T.handrailProtrusion_mm)?f:75)<0)&&S("Correct handrail count and protrusion");let N=(null!=(w=T.handrailCount)?w:2)*(null!=(v=T.handrailProtrusion_mm)?v:75),x=null!=(b=I.bulkheads)?b:[];if((!Array.isArray(x)||x.length>32||x.some(e=>!e||!c(e.start_mm)||!c(e.end_mm)||e.end_mm<=e.start_mm||!c(e.underside_z_mm)||!0!==e.fullWidth))&&S("Each bulkhead needs horizontal start/end, absolute underside height and full-width extent (at most 32)"),M.needs_user_input.length)return M;let E=Math.atan2(T.riser_mm,T.tread_mm),D=I.pitch_deg*Math.PI/180,F=T.riser_mm/T.tread_mm,C=Math.cos(D),O=Math.sin(D),R=e.width_mm,A=e.depth_mm,L=e.height_mm,P=[[R,L,A],[A,L,R],[R,A,L],[L,A,R],[A,R,L],[L,R,A]],U=y.orientationConstraint;for(let e=0;e<P.length;e++){if(!1===y.allowYaw&&e%2||("upright"===U||!1===y.allowTilt||!U&&null!=y.maxPitch_deg)&&e>=2||"flat"===U&&e<2||"on_side"===U&&e<4||U&&!["upright","flat","on_side"].includes(U))continue;let[n,i,a]=P[e],o=[];for(let e of[-a/2,a/2])for(let t of[-i/2,i/2])o.push({x:e*C-t*O,z:e*O+t*C});let r=-Math.min(...o.map(e=>e.z-F*e.x)),l=o.map(e=>({x:e.x,z:e.z+r})),s=function(e){let t=[...e].sort((e,t)=>e.x-t.x||e.z-t.z),n=e=>{let t=[];for(let n of e){for(;t.length>1&&0>=h(t.at(-2),t.at(-1),n);)t.pop();t.push(n)}return t};return[...n(t).slice(0,-1),...n([...t].reverse()).slice(0,-1)]}([...l,...l.map(e=>({x:e.x+I.travel_mm,z:e.z+F*I.travel_mm}))]),m=i*Math.abs(Math.cos(D-E))+a*Math.abs(Math.sin(D-E)),d="parallel"===I.ceilingProfile?T.headroom_mm*("vertical"===I.headroomDirection?Math.cos(E):1):T.headroom_mm,_="parallel"===I.ceilingProfile?m:Math.max(...s.map(e=>e.z)),g=[{axis:"stair_width",actual_mm:n,limit_mm:t.width_mm-N-k,margin_mm:t.width_mm-N-k-n},{axis:"stair_headroom",actual_mm:_,limit_mm:d-k,margin_mm:d-k-_}];for(let e=0;e<x.length;e++){let t=x[e],n=u(u(s,t.start_mm,!0),t.end_mm,!1);g.push(n.length?{axis:"bulkhead",index:e,actual_mm:Math.max(...n.map(e=>e.z)),limit_mm:t.underside_z_mm-k,margin_mm:t.underside_z_mm-k-Math.max(...n.map(e=>e.z))}:{axis:"bulkhead",index:e,status:"outside_swept_region",margin_mm:null})}let p=g.filter(e=>c(e.margin_mm)).reduce((e,t)=>e.margin_mm<t.margin_mm?e:t);M.candidates.push({pose_index:e,pitch_deg:I.pitch_deg,dims:{across_mm:n,vertical_mm:i,along_mm:a},status:p.margin_mm>=0?"clear":"blocked_strategy",margin_mm:p.margin_mm,limiting_constraint:p.axis,checks:g,witness:{slope_rad:E,lift_mm:r,swept_polygon_mm:s,normal_span_mm:m}})}if(!M.candidates.length)return S("Provide a supported carry orientation"),M;if(M.candidates.some(e=>!Number.isFinite(e.margin_mm)||e.witness.swept_polygon_mm.some(e=>!Number.isFinite(e.x)||!Number.isFinite(e.z))))return M.candidates=[],S("Geometry exceeds finite numerical range"),M;M.status=M.candidates.some(e=>"clear"===e.status)?"clear_interior":"no_checked_pose_clears",M.handling_buffer_mm=k,M.rail_deduction_mm=N;let H=function(e,t,n){var i,a,o,m,c,d,h,u;let _=null!=(h=e.stairGeometry)?h:{},g=[],p=e=>{g.includes(e)||g.push(e)};"single_straight_flight"!==n.layout&&p("Declare one straight flight with no adjoining turns"),(null==(i=_._accessSources)?void 0:i.flightModel)==null||r(_._accessSources.flightModel)||p("Resolve the source of the declared flight profile"),r(n.source)||p("Provide measured floor, ceiling, obstruction and staging coverage");let f=n.domain;for(let[e,t]of((!f||!Number.isFinite(f.start_mm)||!Number.isFinite(f.end_mm)||f.start_mm>=f.end_mm||f.start_mm>0||f.end_mm<n.travel_mm||"constant_clear_strip"!==f.wallProfile)&&p("Provide the measured start/end extent of the constant floor, ceiling, wall and rail profile"),[["entry",0],["exit",n.travel_mm]])){let i=n[e];(!i||"object"!=typeof i||i.center_x_mm!==t||!Number.isInteger(i.pose_index)||i.pose_index<0||i.pose_index>5||i.pitch_deg!==n.pitch_deg)&&p("Provide matching fixed-pitch entry and exit poses at the two travel endpoints")}for(let t of((null==(a=n.entry)?void 0:a.pose_index)!==(null==(o=n.exit)?void 0:o.pose_index)&&p("Entry and exit must use the same carried pose"),Array.isArray(n.bulkheads)&&!0===n.obstaclesComplete||p("Confirm complete obstruction coverage, including an explicit empty bulkhead list when none are present"),(!r(l(e,"width"))||e._defaulted||e._widthDefaulted||(null==(m=e._stairGeometrySources)?void 0:m.width)!=null&&!r(e._stairGeometrySources.width))&&p("Provide measured wall-to-wall stair width"),(null==(c=e._stairGeometrySources)?void 0:c.headroom)==null||r(e._stairGeometrySources.headroom)||p("Resolve measured headroom provenance"),["riser","tread","headroom"]))r(l(_,t))||p("Provide measured "+t+" for the entire declared profile");return null!=_.handrailCount&&r(l(_,"handrailCount"))&&(!(_.handrailCount>0)||null!=_.handrailProtrusion_mm&&r(l(_,"handrailProtrusion")))||p("Provide measured handrail count and, when present, protrusion along the entire profile"),(e.has_turn||_.isSpiral||_.isWinder||_.hasLanding||(null!=(u=_.turn_count)?u:0)!==0||(null==(d=t.stairGrid)?void 0:d.hasTurn)||null!=e.turn_angle&&0!==e.turn_angle||t.stairTypeId&&"straight"!==t.stairTypeId||t.calculationType&&"diagonal_fit"!==t.calculationType||["flights","landings","turns","obstacles","rails"].some(t=>s(e[t])||s(_[t])))&&p("Separate turns, special stair types and other regions or obstacles require their own supported model"),{eligible:0===g.length,needs_user_input:g,domain:null!=f?f:null}}(t,y,I);if(M.coverage=H,!H.eligible)return M.needs_user_input.push(...H.needs_user_input),M;let W=M.candidates.find(e=>e.pose_index===I.entry.pose_index);if(!W)return S("The measured endpoint pose is not permitted by the carry restrictions"),M;W.checks.push(...function(e,t,n){let i=e.witness.swept_polygon_mm,a=-Math.min(...i.map(e=>e.x)),o=Math.max(...i.map(e=>e.x))-t.travel_mm;return[{axis:"entry_staging",actual_mm:a,limit_mm:-t.domain.start_mm-n/2,margin_mm:-t.domain.start_mm-n/2-a},{axis:"exit_staging",actual_mm:o,limit_mm:t.domain.end_mm-t.travel_mm-n/2,margin_mm:t.domain.end_mm-t.travel_mm-n/2-o}]}(W,I,k));let G=W.checks.filter(e=>c(e.margin_mm)).reduce((e,t)=>
1e.margin_mm<t.margin_mm?e:t);return(W.margin_mm=G.margin_mm,W.limiting_constraint=G.axis,W.status=G.margin_mm>=0?"clear":"blocked_strategy","clear"!==W.status)?(M.status="no_checked_pose_clears",S("The declared fixed-pose path does not clear; measure a different supported staging region or carry")):(M.status="path_proven",M.scope="declared_straight_stair_translation",M.continuous_path_proven=!0,M.entry_exit_proven=!0,M.selected_pose_index=W.pose_index,M.path={version:"fixed-pitch-translation/1",interpolation:"linear",pitch_deg:I.pitch_deg,pose_index:W.pose_index,lateral_origin:"left_edge_of_constant_clear_strip",centers_mm:[{x:0,y:(t.width_mm-N)/2,z:W.witness.lift_mm},{x:I.travel_mm,y:(t.width_mm-N)/2,z:W.witness.lift_mm+F*I.travel_mm}],domain:{start_mm:I.domain.start_mm,end_mm:I.domain.end_mm,wallProfile:I.domain.wallProfile}},M.limitations=["Only the declared measured straight region and matching endpoint poses are checked.","Pose transitions, adjoining regions, alternate carries and human handling are not included."]),M}(e,t,R),G=[null==t||null==(M=t._accessSources)?void 0:M.width,null==t||null==(S=t._stairGeometrySources)?void 0:S.width,(null==t?void 0:t._widthDefaulted)||(null==t?void 0:t._defaulted)?"assumed":null],q=(0,_.CE)(e,null==t?void 0:t.width_mm,G);H||(null==U?void 0:U.obstruction_proven)||(O=q||"path_proven"!==W.status?(0,_.to)(O,q,W,(0,_.IX)(e,null==t?void 0:t.width_mm,G),{allowEnvelope:(null==W?void 0:W.inputs)==null&&"single_region"===L.status}):{...function(e,t,n,i){if("path_proven"!==i.status)return null;let r=i.candidates.find(e=>e.pose_index===i.selected_pose_index),l=r.checks.filter(e=>Number.isFinite(e.margin_mm)),s=l.findIndex(e=>e.margin_mm===r.margin_mm),m=l.map((a,o)=>({id:"axis_inequality",passed:!0,limiting:o===s,values:{axis:a.axis,item_dim_mm:a.actual_mm,space_dim_mm:a.limit_mm,margin_mm:a.margin_mm,pose_index:r.pose_index,pitch_deg:r.pitch_deg,check_index:o,...0===o?{stair_flight_input:function(e,t,n){let i=t.stairGeometry,a=i.flightModel,o=(e,t)=>{var n,i;return null!=(i=null==(n=e._accessSources)?void 0:n[t])?i:e.dimensionSource},r=e=>({center_x_mm:e.center_x_mm,pose_index:e.pose_index,pitch_deg:e.pitch_deg});return{item:{width_mm:e.width_mm,depth_mm:e.depth_mm,height_mm:e.height_mm},stairs:{type:"stairs",width_mm:t.width_mm,_accessSources:{width:o(t,"width")},stairGeometry:{riser_mm:i.riser_mm,tread_mm:i.tread_mm,headroom_mm:i.headroom_mm,handrailCount:i.handrailCount,handrailProtrusion_mm:i.handrailProtrusion_mm,_accessSources:Object.fromEntries(["riser","tread","headroom","handrailCount","handrailProtrusion"].map(e=>[e,o(i,e)])),flightModel:{floorProfile:a.floorProfile,ceilingProfile:a.ceilingProfile,headroomDirection:a.headroomDirection,pitch_deg:a.pitch_deg,travel_mm:a.travel_mm,source:a.source,layout:a.layout,obstaclesComplete:a.obstaclesComplete,domain:{start_mm:a.domain.start_mm,end_mm:a.domain.end_mm,wallProfile:a.domain.wallProfile},entry:r(a.entry),exit:r(a.exit),bulkheads:a.bulkheads.map(e=>({start_mm:e.start_mm,end_mm:e.end_mm,underside_z_mm:e.underside_z_mm,fullWidth:e.fullWidth}))}}},config:Object.fromEntries(["tolerance_mm","orientationConstraint","maxPitch_deg","allowTilt","allowYaw"].filter(e=>void 0!==n[e]).map(e=>[e,n[e]]))}}(e,t,n),stair_flight_path:i.path}:{}},comparison:{actual_mm:a.actual_mm,limit_mm:a.limit_mm,margin_mm:a.margin_mm}})),c=o[r.pose_index],d=l.find(e=>"stair_width"===e.axis),h=l.find(e=>"stair_headroom"===e.axis);return{...(0,a.K8)(r.margin_mm),method:"declared_stair_translation",check_scope:i.scope,solver_identity:i.version,support_category:"declared_fixed_pose_path",proof_variant:"declared_stair_translation",pipeline_complete:!0,continuous_path_proven:!0,obstruction_proven:!1,response_act:"answer",confidence:"HIGH",needs_user_input:[],margin_mm:r.margin_mm,limiting_constraint:r.limiting_constraint,tolerance_mm:i.handling_buffer_mm,search_space_exhausted:!1,proofSteps:m,stairFlightCheck:i,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{stair_width_mm:t.width_mm,headroom_mm:t.stairGeometry.headroom_mm,effective_width_mm:d.limit_mm},checked_orientations:[{orientation:c,feasible:!0,margin_mm:r.margin_mm,dims:r.dims,pitch_deg:r.pitch_deg,width_clearance_mm:d.margin_mm,height_clearance_mm:h.margin_mm,checks:{width:d,headroom:h},limitingConstraint:r.limiting_constraint}],orientationRationale:"The measured entry and exit use the same pose at ".concat(r.pitch_deg,"\xb0 world pitch; that entire translation clears the declared profile."),message:"The item clears the declared straight stair region in the specified fixed pose, including the measured entry and exit staging.",assumptions:["The measured upper nosing envelope, ceiling and constant clear strip cover the entire swept body.","The item starts in the declared pose; no pitch or orientation transition is included."],warnings:i.limitations,details:{stair_width_mm:t.width_mm,effective_width_mm:d.limit_mm,headroom_mm:t.stairGeometry.headroom_mm,riser_mm:t.stairGeometry.riser_mm,tread_mm:t.stairGeometry.tread_mm,nosing_mm:t.stairGeometry.nosing_mm,handrailCount:t.stairGeometry.handrailCount,handrailProtrusion_mm:t.stairGeometry.handrailProtrusion_mm,best_orientation:c,best_orientation_dims:r.dims,carry_pitch_deg:r.pitch_deg,stairGeometryAssumed:!1}}}(e,t,R,W),stairConsistency:P}),O.accessPathMeasurements=(0,v.df)(t,O,R),O.regionCoverage=L;let j=Number.isFinite(null==t?void 0:t.width_mm)&&t.width_mm>0&&!((null==t?void 0:t._widthDefaulted)||(null==t?void 0:t._defaulted))&&![null==t||null==(k=t._accessSources)?void 0:k.width,null==t||null==(N=t._stairGeometrySources)?void 0:N.width].some(e=>null!=e&&/assumed|default/.test(e)),z=null!=(C=null==t||null==(x=t._stairGeometrySources)?void 0:x.headroom)?C:null==t||null==(D=t.stairGeometry)||null==(E=D._accessSources)?void 0:E.headroom,V=Number.isFinite(null==t||null==(F=t.stairGeometry)?void 0:F.headroom_mm)&&!(null!=z&&(null==z||/assumed|default/.test(z)));return j||V||(O.stair_geometry_assumed=!0),(0,f.JU)(O,R)}},59296:(e,t,n)=>{n.d(t,{CZ:()=>i,MW:()=>d});let i=Object.freeze({FULL:"FULL",PARTIAL:"PARTIAL",APPROXIMATION:"APPROXIMATION",FALLBACK:"FALLBACK",UNSUPPORTED:"UNSUPPORTED"}),a=Object.freeze({MISSING_CONSTRAINTS:"SUPPORT_MISSING_CONSTRAINTS",REDUCED_GEOMETRY:"SUPPORT_REDUCED_GEOMETRY",ESTIMATED_CATALOG_FACTS:"SUPPORT_ESTIMATED_CATALOG_FACTS",UNSUPPORTED_SHAPE:"SUPPORT_UNSUPPORTED_SHAPE",VOLUME_ONLY_APPROXIMATION:"SUPPORT_VOLUME_ONLY_APPROXIMATION",UNAVAILABLE_SOLVER:"SUPPORT_UNAVAILABLE_SOLVER",ACTUAL_SOLVER_UNDETERMINED:"SUPPORT_ACTUAL_SOLVER_UNDETERMINED",SEARCH_INCOMPLETE:"SUPPORT_SEARCH_INCOMPLETE",CONTINUOUS_PATH_NOT_PROVEN:"SUPPORT_CONTINUOUS_PATH_NOT_PROVEN",UNSUPPORTED_TOPOLOGY:"SUPPORT_UNSUPPORTED_TOPOLOGY",CLIENT_SOLVER_VERSION_UNVERIFIED:"SUPPORT_CLIENT_SOLVER_VERSION_UNVERIFIED"});Object.freeze(["FITS","DOESNT_FIT","FITS_TIGHT","FITS_VERY_TIGHT","FITS_WONT_CLOSE","FITS_TILTED"]),Object.freeze({FULL:Object.freeze({may_emit:Object.freeze(["definitive","likely","conditional","unknown"]),ceiling:"definitive"}),PARTIAL:Object.freeze({may_emit:Object.freeze(["likely","conditional","unknown"]),ceiling:"conditional"}),APPROXIMATION:Object.freeze({may_emit:Object.freeze(["likely","conditional","unknown"]),ceiling:"likely"}),FALLBACK:Object.freeze({may_emit:Object.freeze(["conditional","unknown"]),ceiling:"conditional"}),UNSUPPORTED:Object.freeze({may_emit:Object.freeze(["unknown"]),ceiling:"unknown"})});let o=["opening","hallway","container","elevator","room","panel_elevator_inverse","opening_multi_item","container_multi_item","elevator_multi_item","hallway_multi_item","room_multi_item","slot-fit"],r=["vehicle","vehicle_multi_space","vehicle_multi_item","vehicle_multi_item_multi_space","capacity","move_size","catalog-fit","scan_verdict","inventory-fit"],l=["stairs","turn","turn_multi_item","stairs_multi_item","tightest_blocker","cross-constraint","hybrid","motion","motion_corner","maneuver_discovery","maneuver_discovery_multi","load_capacity","residual","arrangement","comparison","optimization","space-sizing","turn_required_width"],s=[...o.map(e=>[e,i.FULL,[]]),...r.map(e=>[e,i.APPROXIMATION,["capacity"===e||"move_size"===e?a.VOLUME_ONLY_APPROXIMATION:a.REDUCED_GEOMETRY]]),...l.map(e=>[e,i.PARTIAL,["hybrid"===e||"stairs"===e||"turn"===e||"stairs_multi_item"===e||"turn_multi_item"===e||"tightest_blocker"===e||"cross-constraint"===e||e.startsWith("motion")||e.startsWith("maneuver")?a.CONTINUOUS_PATH_NOT_PROVEN:a.REDUCED_GEOMETRY]]),["full_load_plan",i.UNSUPPORTED,[a.UNAVAILABLE_SOLVER]],["incomplete",i.UNSUPPORTED,[a.MISSING_CONSTRAINTS]],["unresolved_solver",i.FALLBACK,[a.ACTUAL_SOLVER_UNDETERMINED]]],m=Object.freeze({door:"opening",doorway:"opening",opening_fit:"opening",hallway_fit:"hallway",stairs_fit:"stairs",turn_fit:"turn",container_fit:"container",room_fit:"room",vehicle_exterior_vs_space:"vehicle",batch_vehicle:"vehicle_multi_item","batch-vehicle":"vehicle_multi_item",reverse_fit:"space-sizing",reversefit:"space-sizing",slot_fit:"slot-fit",inventory_fit:"inventory-fit",catalog_fit:"catalog-fit",multi_constraint:"cross-constraint",cross_constraint:"cross-constraint"}),c=Object.freeze(Object.fromEntries(s.map(e=>{let[t,n,i]=e;return[t,Object.freeze({solver_id:t,aliases:Object.freeze(Object.entries(m).filter(e=>{let[,n]=e;return n===t}).map(e=>{let[t]=e;return t})),lifecycle_status:"full_load_plan"===t?"placeholder":"incomplete"===t?"sentinel":"unresolved_solver"===t?"fallback":"production",support_owner:"solver",default_support_level:n,default_reason_codes:Object.freeze(i)})]})));function d(){var e,t,n,o,r,l,s,d,h;let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=String(null!=e?e:"").trim().toLowerCase().replace(/\s+/g,"_"),a=String(null!=n?n:"").trim().toLowerCase().replace(/\s+/g,"_");
1if("batch-vehicle"===a||"batch_vehicle"===a)return"vehicle_multi_item";if("vehicle"===a||"vehicle_in_space"===a)return"vehicle";if(!i)return"unresolved_solver";let o=null!=(t=m[i])?t:i;return c[o]?o:"unresolved_solver"}(null!=(t=null!=(e=u.solverId)?e:u.solver_used)?t:u.solverUsed,null!=(n=u.queryType)?n:u.query_type),g=c[_],p=null!=(o=u.supportLevel)?o:g.default_support_level,f=[...g.default_reason_codes,...null!=(l=null!=(r=u.reasonCodes)?r:u.support_reason_codes)?l:[]];if(u.missingConstraints&&(p=i.UNSUPPORTED,f.push(a.MISSING_CONSTRAINTS)),u.unsupportedShape&&(p=i.UNSUPPORTED,f.push(a.UNSUPPORTED_SHAPE)),u.unsupportedTopology&&(p=i.UNSUPPORTED,f.push(a.UNSUPPORTED_TOPOLOGY)),u.solverUnavailable&&(p=i.FALLBACK,f.push(a.UNAVAILABLE_SOLVER)),u.searchIncomplete&&(p=i.PARTIAL,f.push(a.SEARCH_INCOMPLETE)),u.estimatedCatalogFacts&&p===i.FULL&&(p=i.APPROXIMATION),u.estimatedCatalogFacts&&f.push(a.ESTIMATED_CATALOG_FACTS),!Object.values(i).includes(p))throw TypeError("Unknown support level: ".concat(p));let w=function(e){let t=new Set(Object.values(a));return[...new Set((null!=e?e:[]).filter(e=>t.has(e)))].sort()}(f);if(p!==i.FULL&&0===w.length)throw TypeError("Non-FULL support requires a governed reason code");return Object.freeze({solver_id:_,solver_registry_version:"solver-identifiers/2",support_level:p,support_reason_codes:w,support_schema_version:"solver-support/1",solver_config_version:String(null!=(s=u.solverConfigVersion)?s:"unavailable"),template_version:String(null!=(d=u.templateVersion)?d:"unavailable"),parser_version:String(null!=(h=u.parserVersion)?h:"unavailable")})}Object.freeze({web_spatial_fresh:Object.freeze({solver_ids:Object.freeze([...o,...r,...l]),persistence:"shared_fit_check_writer"}),web_spatial_early_return:Object.freeze({solver_ids:Object.freeze(["incomplete","unresolved_solver"]),persistence:"shared_fit_check_writer"}),web_spatial_cache:Object.freeze({solver_ids:Object.freeze([...o,...r,...l]),persistence:"shared_fit_check_writer"}),vehicle:Object.freeze({solver_ids:Object.freeze(["vehicle"]),persistence:"fit_check_results_api"}),batch_vehicle:Object.freeze({solver_ids:Object.freeze(["vehicle_multi_item","vehicle_multi_space","vehicle_multi_item_multi_space"]),persistence:"fit_check_results_api"}),extension:Object.freeze({solver_ids:Object.freeze([...o,...r,...l,"incomplete","unresolved_solver"]),persistence:"shared_fit_check_writer"}),widget:Object.freeze({solver_ids:Object.freeze([...o,...r,...l,"incomplete","unresolved_solver"]),persistence:"shared_fit_check_writer"}),fallback_degraded:Object.freeze({solver_ids:Object.freeze(["unresolved_solver","incomplete","full_load_plan"]),persistence:"shared_fit_check_writer"})})},61378:(e,t,n)=>{n.d(t,{P:()=>o,S:()=>a});let i=(0,n(96648).createClient)();async function a(e){try{let{data:{session:e}}=await i.auth.getSession();if(null==e?void 0:e.access_token)return e.access_token}catch(e){}return null!=e?e:null}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await a(t);return n?{...e,Authorization:"Bearer ".concat(n)}:{...e}}},62757:(e,t,n)=>{n.d(t,{Ox:()=>p,Py:()=>g,lm:()=>_,zP:()=>u});var i=n(68505),a=n(80986);let o="/api/engagement",r=new Map,l=!1,s=!1;function m(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()}function c(){try{return(0,i.c7)(i.O3.SESSION_ID)}catch(e){return null}}function d(e){try{fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})}catch(e){}}function h(){if(s||0===r.size)return;s=!0;let e=c();for(let[t,n]of r.entries())e&&!n.responseDelivered&&function(e){try{let t=JSON.stringify(e);if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(o,new Blob([t],{type:"application/json"})))return}catch(e){}d(e)}({sessionId:e,eventType:"query_abandoned",interactionSequenceId:t,queryType:n.queryType||null,metadata:{wait_ms:Math.round(m()-n.t0),phase:"awaiting_verdict"},sourceComponent:"queryAbandonBeacon"}),r.delete(t);s=!1}function u(e){let{queryType:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let n=c();n&&(l||(l=!0,window.addEventListener("pagehide",h,{capture:!0})),r.set(e,{t0:m(),queryType:t||null,responseDelivered:!1}),d({sessionId:n,eventType:"query_submitted",interactionSequenceId:e,queryType:t||null,metadata:{...(0,a.t)()},sourceComponent:"queryAbandonBeacon"}))}function _(e){let{verdict:t,queryType:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let i=r.get(e);if(!i)return;r.delete(e);let o=c();o&&d({sessionId:o,eventType:"verdict_rendered",interactionSequenceId:e,verdict:t||null,queryType:n||null,metadata:{wait_ms:Math.round(m()-i.t0),...(0,a.t)()},sourceComponent:"queryAbandonBeacon"})}
1function g(e){e&&"assistant"===e.role&&e.clientTurnId&&(e.isTeaser||function(e){if(!e)return;let t=r.get(e);t&&(t.responseDelivered=!0)}(e.clientTurnId))}function p(e){e&&r.delete(e)}},64295:(e,t,n)=>{n.d(t,{D_:()=>s,zE:()=>d});var i=n(27836);let a="door_then_turn",o=e=>Number.isFinite(e)&&e>0,r=new Set(["doorway","opening"]),l=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)&&1>=Math.abs(e-t);function s(e){if(!Array.isArray(e)||!e.some(e=>(null==e?void 0:e.type)==="turn"))return e;let t=!1,n=[];for(let s of e){var a;let e=n[n.length-1],m=e&&r.has(e.type)?e:null;if((null==s?void 0:s.type)!=="turn"||!m||s._doorThenTurn){n.push(s);continue}let c=!0===s.behind_opening,d=!c&&o(s.landing_d_mm)&&(null==s.width_mm||l(s.width_mm,m.width_mm))&&(null==s.landing_w_mm||l(s.landing_w_mm,m.width_mm))&&(null==s.width_after_mm||l(s.width_after_mm,m.width_mm));if(!c&&!d){n.push(s);continue}t=!0;let h=c?s.width_after_mm:s.landing_d_mm;if(!o(h)){n[n.length-1]={...m,has_turn:!0,turn_wall_distance_needed:!0};continue}let u=function(e){if(!e)return null;let{width_mm:t,height_mm:n,front_wall_distance_mm:a,ceiling_height_mm:r}=e;if(!o(t)||!o(n)||!o(a))return null;let l=o(r),s=l?Math.min(n,r):n;return{type:"turn",name:"Turn inside the door",width_mm:t,width_after_mm:a,height_mm:s,turn_angle:90,...e.dimensionSource?{dimensionSource:e.dimensionSource}:{},_doorThenTurn:{door_width_mm:t,door_height_mm:n,front_wall_distance_mm:a,ceiling_height_mm:l?r:null,turn_height_mm:s,side_wall_distance_mm:Number.isFinite(e.side_wall_distance_mm)&&e.side_wall_distance_mm>=0?e.side_wall_distance_mm:null,source:(0,i.KL)(e,"width",t)}}}({width_mm:m.width_mm,height_mm:m.height_mm,front_wall_distance_mm:h,ceiling_height_mm:s.height_mm,dimensionSource:m._widthDefaulted||m._defaulted?"default":m.dimensionSource}),{behind_opening:_,landing_w_mm:g,landing_d_mm:p,...f}=s;n.push(null!=u?u:{...f,width_mm:null!=(a=f.width_mm)?a:m.width_mm,width_after_mm:h,turn_angle:90})}return t?n:e}let m=Object.freeze({checked:"We checked the doorway and the turn right inside it, treating the doorway as a corridor as wide as its opening.",turnNotShown:"We checked the doorway, but couldn't show the item making the turn right inside it. That doesn't prove it can't; a different angle or tilt may still work.",notModelled:"Door swing, trim, side walls and how far the space runs after the turn are not modelled, so the whole way in is not proven.",ceilingFromDoor:"The ceiling height inside was not given, so the turn uses the door height."}),c=/^Doorway results are opening or already-aligned entry checks\./;function d(e){var t,n,o,r;let l=Array.isArray(null==e?void 0:e.pathResults)?e.pathResults:[],s=l.find(e=>null==e?void 0:e._doorThenTurn);if(!s)return e;let d=s._doorThenTurn,h=l.find(e=>(null==e?void 0:e._spaceType)==="doorway"||(null==e?void 0:e._spaceType)==="opening"),u=null!=(t=d.source)?t:"provided_source_unknown",_=s.verdict&&"UNKNOWN"!==s.verdict?"evaluated":"recorded_but_not_evaluated",g=[{...(0,i.PG)("front_wall_distance_mm","Distance from the door to the facing wall",d.front_wall_distance_mm,u),evaluationStatus:_,constraintRef:a,note:"Used as the width after the turn."},...null!=d.ceiling_height_mm?[{...(0,i.PG)("inside_ceiling_height_mm","Ceiling height inside the door",d.ceiling_height_mm,u),evaluationStatus:_,constraintRef:a}]:[],...null!=d.side_wall_distance_mm?[{...(0,i.PG)("side_wall_distance_mm","Side wall distance",d.side_wall_distance_mm,u),constraintRef:a,note:"Recorded, not checked."}]:[]],p={model_version:"door-then-turn/1",scope:a,status:"evaluated"===_?"door_and_turn_checked":"turn_not_established",front_wall_distance_mm:d.front_wall_distance_mm,side_wall_distance_mm:d.side_wall_distance_mm,ceiling_height_mm:d.ceiling_height_mm,turn_width_before_mm:d.door_width_mm,turn_width_after_mm:d.front_wall_distance_mm,turn_height_mm:d.turn_height_mm,opening_verdict:null!=(n=null==h?void 0:h.verdict)?n:null,turn_verdict:null!=(o=s.verdict)?o:null,front_evaluation_status:_,side_evaluation_status:"recorded_but_not_evaluated",door_swing_modelled:!1,trim_modelled:!1,continuous_path_proven:!1,exit_path_proven:!1,turning_path_proven:!1},f=new Set(["front_wall_distance_mm","side_wall_distance_mm"]),w=l.map(e=>{var t;return e===s?{...e,accessPathMeasurements:[...g,...(null!=(t=e.accessPathMeasurements)?t:[]).filter(e=>(null==e?void 0:e.key)==="turn_angle")]}:e===h&&Array.isArray(e.accessPathMeasurements)?{...e,accessPathMeasurements:e.accessPathMeasurements.filter(e=>
1!(f.has(null==e?void 0:e.key)&&(null==e?void 0:e.value)==null))}:e});return{...e,pathResults:w,accessPathCheck:p,check_scope:a,continuous_path_proven:!1,assumptions:[...new Set([...(null!=(r=e.assumptions)?r:[]).filter(e=>!c.test(String(e))),..."evaluated"===_?[m.checked]:(null==h?void 0:h.verdict)==="DOESNT_FIT"?[]:[m.turnNotShown],...null==d.ceiling_height_mm?[m.ceilingFromDoor]:[],m.notModelled])]}}},65927:(e,t,n)=>{n.d(t,{Rw:()=>y,BL:()=>T,GV:()=>N});var i=n(58271),a=n(74737),o=n(89175),r=n(26236),l=n(89609),s=n(16979),m=n(85850);let c=e=>Math.round(Number(e)||0),d=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Math.sqrt(t.reduce((e,t)=>e+(Number(t)||0)**2,0))};function h(e){let{item:t,container:n,orientation:i,margins:a,fits:o}=e;if(!t||!n||!i||!a)return[];let r=[],l=c(t.length)*c(t.width)*c(t.height),s=c(n.length)*c(n.width)*c(n.height);r.push({id:"volume_inequality",passed:s-l>=0,limiting:!1,values:{total_item_vol_mm3:c(l),container_vol_mm3:c(s),headroom_mm3:c(s-l)}});let h=[{axis:"length",item_mm:i.l,space_mm:n.length,margin_mm:c(a.length)},{axis:"width",item_mm:i.w,space_mm:n.width,margin_mm:c(a.width)},{axis:"height",item_mm:i.h,space_mm:n.height,margin_mm:c(a.height)}],u=0;for(let e=1;e<h.length;e++)h[e].margin_mm<h[u].margin_mm&&(u=e);return h.forEach((e,t)=>{r.push({id:"axis_inequality",passed:e.margin_mm>=0,limiting:t===u,values:{item_dim_mm:c(e.item_mm),space_dim_mm:c(e.space_mm),axis:e.axis,margin_mm:e.margin_mm},comparison:{actual_mm:c(e.item_mm),limit_mm:c(e.space_mm),margin_mm:e.margin_mm}}
1)}),r.push(...(0,m.kj)({itemFace:{a_mm:i.l,b_mm:i.w},spaceFace:{a_mm:n.length,b_mm:n.width},itemReach:{l_mm:i.l,w_mm:i.w,h_mm:i.h},spaceReachDiag_mm:d(n.length,n.width,n.height),fits:o})),r}function u(e){let{itemDims:t,containerDims:n,fits:i,tolerance_mm:a=0}=e,o=(t||[]).filter(e=>Number(e)>0).sort((e,t)=>e-t),r=(n||[]).filter(e=>Number(e)>0).sort((e,t)=>e-t);if(0===Math.min(o.length,r.length))return[];let l=o[0]||0,s=o[1]||o[0]||0,c=o[2]||o[1]||o[0]||0,d=r[0]||0,u=r[1]||r[0]||0,_=r[2]||r[1]||r[0]||0,g=h({item:{length:l,width:s,height:c},container:{length:d,width:u,height:_},orientation:{l:l,w:s,h:c},margins:{length:d-l,width:u-s,height:_-c},fits:i});return(0,m.ke)(g,{tolerance_mm:a})}var _=n(97360),g=n(27236),p=n(95704);let f=new Set(["heuristic","estimated","llm_estimated","default","missing"]),w=e=>e&&["length","width","height"].every(t=>"number"==typeof e[t]&&Number.isFinite(e[t])&&e[t]>0);var v=n(95704);function b(e,t){let{items:n,effectiveContainer:a,rawContainer:o,config:r}=t,l=function(){let e=String(void 0!==p&&p.env.CONTAINER_BORDERLINE_TOLERANCE||"off").toLowerCase();return"shadow"===e||"live"===e?e:"off"}();if("off"===l||1!==n.length||!r.borderlineProvenances||"DOESNT_FIT"!==e.verdict&&"LIKELY_DOESNT_FIT"!==e.verdict||"borderline"!==function(){let{margin_mm:e,provenances:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"number"!=typeof e||!Number.isFinite(e)||Math.abs(e)>6?"hard_no":(t&&"object"==typeof t?Object.values(t):[]).some(e=>f.has(e))?"borderline":"tight_fit"}({margin_mm:e.margin_mm,provenances:r.borderlineProvenances}))return e;let s=function(){let{margin_mm:e,limiting_constraint:t,items:n,container:i,rawContainer:a,isInternal:o,clearance_mm:r,wall_thickness_mm:l,provenances:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("number"!=typeof e||!Number.isFinite(e))return null;let m=Array.isArray(n)?n:[];return!(!m.length||!m.every(w)||!w(i)||!s||"object"!=typeof s||Array.isArray(s))?{schema_version:2,reason_code:"estimate_within_tolerance",margin_mm:e,limiting_constraint:"string"==typeof t?t:null,item_dims_mm:m.map(e=>{let{length:t,width:n,height:i}=e;return{length:t,width:n,height:i}}),container_dims_mm:{length:i.length,width:i.width,height:i.height},...w(a)&&{raw_container_dims_mm:{length:a.length,width:a.width,height:a.height}},dimension_policy:{is_internal:!0===o,clearance_mm:Number.isFinite(r)?r:null,wall_thickness_mm:Number.isFinite(l)?l:null},governing_provenances:{...s}}:null}({margin_mm:e.margin_mm,limiting_constraint:e.limiting_constraint,items:n,container:a,rawContainer:o,isInternal:r.is_internal,clearance_mm:r.clearance_mm,wall_thickness_mm:r.wall_thickness_mm,provenances:r.borderlineProvenances});return s&&(e._borderlineEvidence=s),"shadow"===l?(i.U.warn("[CONTAINER-BORDERLINE-SHADOW] would soften hard-No to borderline",JSON.stringify({margin_mm:e.margin_mm,verdict:e.verdict})),e._borderlineShadow=!0):(e.borderline=!0,e.borderlineReason="estimate_within_tolerance","HIGH"===e.confidence&&(e.confidence="MEDIUM"),e.needs_user_input=[...e.needs_user_input||[],"Container interior dimensions (width \xd7 depth \xd7 height) for an exact answer"],e.assumptions=[...e.assumptions||[],"Borderline: the miss is within measuring tolerance and a governing dimension is estimated. Share the interior W\xd7D\xd7H for an exact answer."]),e}function y(e){let{length:t,width:n,height:i}=e;return[{l:t,w:n,h:i},{l:t,w:i,h:n},{l:n,w:t,h:i},{l:n,w:i,h:t},{l:i,w:t,h:n},{l:i,w:n,h:t}]}function T(e,t){let{l:n,w:i,h:a}=e,{length:o,width:r,height:l}=t;return n===o&&i===r&&a===l?"Upright":a===l?"Rotated 90\xb0":"On its side"}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=y(e);if(a=(0,l.sH)(a,n,e),null!==i){if(0===i.length)return{fits:!1,orientation:null,margins:null,closestMiss:null,attemptHistory:[],_noValidOrientation:!0};a=a.filter(e=>i.some(t=>5>Math.abs(e.l-(t.l||0))&&5>Math.abs(e.w-(t.w||0))&&5>Math.abs(e.h-(t.h||0))))}let o=null,r=-1/0,s=[];for(let n of a){let i=n.l<=t.length&&n.w<=t.width&&n.h<=t.height,a=T(n,e);if(i){let e={length:t.length-n.l,width:t.width-n.w,height:t.height-n.h},i=Math.min(e.length,e.width,e.height);s.push({orientation:{l:n.l,w:n.w,h:n.h},fits:!0,label:a,margin_mm:Math.round(i)}),i>
1r&&(r=i,o={fits:!0,orientation:n,margins:e,minMargin:i})}else s.push({orientation:{l:n.l,w:n.w,h:n.h},fits:!1,label:a})}if(o)return o.attemptHistory=s,o;let m=null,c=1/0;for(let e of a){let n=Math.max(0,e.l-t.length),i=Math.max(0,e.w-t.width),a=Math.max(0,e.h-t.height),o=n+i+a;o<c&&(c=o,m={orientation:e,violations:{length:n,width:i,height:a}})}return{fits:!1,orientation:null,margins:null,closestMiss:m,attemptHistory:s}}function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof n&&(n={mode:n});let{mode:i="coexistence",packed:a=null,fillRatio:o=null,tolerance_mm:r=0,packedGeometry:l=null}=n,s=0;for(let t of e)t&&t.length&&t.width&&t.height&&(s+=t.length*t.width*t.height);let c=(t.length||0)*(t.width||0)*(t.height||0),d=c-s,u=c>0&&s>c,g=e.some(e=>!I(e,t).fits),p={id:"volume_inequality",passed:c>0&&s<=c,values:{total_item_vol_mm3:Math.round(s),container_vol_mm3:Math.round(c),headroom_mm3:Math.round(d)},comparison:{actual_mm:Math.round(s),limit_mm:Math.round(c),margin_mm:Math.round(d)},limiting:u},f=(0,m.a9)({packed:a,volOverflow:u,anyItemFailed:g,fillRatio:null!=o?o:c>0?Math.round(s/c*100)/100:null,packedGeometry:l});return(0,_.d)({items:e.map(e=>({name:null==e?void 0:e.name,dims:{length_mm:Math.round((null==e?void 0:e.length)||0),width_mm:Math.round((null==e?void 0:e.width)||0),height_mm:Math.round((null==e?void 0:e.height)||0)}})),mode:i,perItemSteps:(n,i)=>{var a;let o=e[i]||{},l=I(o,t),s=l.fits?l.orientation:(null==(a=l.closestMiss)?void 0:a.orientation)||{l:(null==o?void 0:o.length)||0,w:(null==o?void 0:o.width)||0,h:(null==o?void 0:o.height)||0},c={length:Math.round((t.length||0)-(s.l||0)),width:Math.round((t.width||0)-(s.w||0)),height:Math.round((t.height||0)-(s.h||0))},d=h({item:{length:o.length||0,width:o.width||0,height:o.height||0},container:t,orientation:s,margins:c,fits:l.fits}).filter(e=>"volume_inequality"!==e.id);return l.fits||(d=(0,m.ke)(d,{tolerance_mm:r})),d},collective:[p,f]})}function S(e){let t=Math.min(e.length,e.width,e.height);return e.length===t?"length":e.width===t?"width":"height"}function k(e){let t=Math.max(e.length,e.width,e.height);return e.length===t?"length":e.width===t?"width":"height"}function N(e,t){let n,l,m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{clearance_mm:c=2,is_internal:d=!1,wall_thickness_mm:_=3,provenances:p=null,closureType:f="open",orientationConstraint:w=null,allowedOrientations:N,preferredUnit:x="in",dimensionsExplicitlyDeclared:E=!1}=m,D=e=>{if("mm"===x)return"".concat(Math.round(e)," mm");if("cm"===x)return"".concat(Math.round(e/10)," cm");let t=e/25.4;if(1>Math.abs(t)){let e=Math.round(10*t)/10;return"".concat(e,'"')}return"".concat(Math.round(t),'"')},F=[],C=Array.isArray(t)?t:[t];if(0===C.length)return{verdict:"UNKNOWN",unknown_reason:g.r.MISSING_ITEM_DIMS,margin_mm:0,confidence:"LOW",method:"no_items",limiting_constraint:"no_items_provided",checked_orientations:[],assumptions:["No items provided to check"],tolerance_mm:c,needs_user_input:["At least one item to check"],queryType:"container_fit"};let O=[];if((!e.length||e.length<=0)&&O.push("Container requires valid length"),(!e.width||e.width<=0)&&O.push("Container requires valid width"),(!e.height||e.height<=0)&&O.push("Container requires valid height"),C.forEach((e,t)=>{(!e.length||e.length<=0)&&O.push("Item ".concat(t+1," requires valid length")),(!e.width||e.width<=0)&&O.push("Item ".concat(t+1," requires valid width")),(!e.height||e.height<=0)&&O.push("Item ".concat(t+1," requires valid height"))}),O.length>0)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"dimension_validation",limiting_constraint:"missing_dimensions",checked_orientations:[],assumptions:[],tolerance_mm:c,needs_user_input:O,showVisualization:!0,queryType:"container_fit",cta:"Clarify the following for better accuracy, or continue to view 3D with our estimates"};if(d)n={length:e.length-c,width:e.width-c,height:e.height-c},c>0&&F.push("Applied ".concat(D(c)," packing clearance"));else{n={length:e.length-2*_,width:e.width-2*_,height:e.height-2*_};let t=e.name||e.containerType||m.containerType||f||"",i=/suitcase|luggage|carry.on|backpack|bag|duffel|gym|messenger|tote|purse|fanny/i.test(t)?"typical fabric/shell":/plastic|bin/i.test(t)?"typical plastic":/crate|wood/i.test(t)?"typical wood":"typical cardboard";F.push("Assuming ".concat(D(_)," wall thickness (").concat(i,")"))}let R=function(e,t){let n=[e.length||0,e.width||0,e.height||0].filter(e=>e>0);if(0===n.length)return null;let i=Math.max(...n),a=3===n.length;for(let e=0;e<t.length;e++){let n=t[e],o=[n.length,n.width,n.height].filter(e=>null!=e&&e>0);if(0===o.length)continue;let r=Math.max(...o);if(a&&r>i)return{isImpossible:!0,reason:"Item ".concat(e+1,"'s largest dimension (").concat(r,"mm) exceeds container's largest dimension (").concat(i,"mm)"),violation_mm:r-i,itemIndex:e};let l=Math.min(...o);if(l>i)return{isImpossible:!0,reason:"Item ".concat(e+1,"'s smallest dimension (").concat(l,"mm) exceeds container's largest dimension (").concat(i,"mm)"),violation_mm:l-i,itemIndex:e}}{let n=0,i=t.length>0;for(let e of t)e.length&&e.width&&e.height?n+=e.length*e.width*e.height:i=!1;if(i&&e.length&&e.width&&e.height){let i=e.length*e.width*e.height;if(n>i)return{isImpossible:!0,reason:t.length>1?"Combined item volume (".concat(Math.round(n/1e3),"cm\xb3) exceeds container volume (").concat(Math.round(i/1e3),"cm\xb3)"):"Item volume (".concat(Math.round(n/1e3),"cm\xb3) exceeds container volume (").concat(Math.round(i/1e3),"cm\xb3)"),violation_mm:Math.round(Math.cbrt(n-i)),volumeExceeded:!0}}}return null}(n,C);if(R){let t,i,a;if(C.length>1){let e=M(C,n,{mode:"coexistence",packed:!1});t=e.proofSteps,i=e.multiItem,a=e.items}else{let e=C[0],i=u({itemDims:[(null==e?void 0:e.length)||0,(null==e?void 0:e.width)||0,(null==e?void 0:e.he
1ight)||0],containerDims:[n.length||0,n.width||0,n.height||0],fits:!1,tolerance_mm:c});t=i.length>0?i:void 0}let o=function(e,t){let n=[(null==e?void 0:e.length)||0,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0].filter(e=>e>0).sort((e,t)=>t-e);if(0===n.length)return null;let i=1/0;for(let e of t||[]){let t=[(null==e?void 0:e.length)||0,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0].filter(e=>e>0).sort((e,t)=>t-e);if(0===t.length)continue;let a=Math.min(t.length,n.length);for(let e=0;e<a;e++)i=Math.min(i,n[e]-t[e])}return Number.isFinite(i)?Math.round(i):null}(n,C),r=null!=o&&o<0;return b({verdict:"DOESNT_FIT",margin_mm:r?o:-R.violation_mm,confidence:"HIGH",method:"early_impossibility_detection",limiting_constraint:r?"item_dimension":R.volumeExceeded?"volume":"item_dimension",...r&&{tightestPoint:{entityA:"item",entityB:"container",axis:"unknown",clearance_mm:o}},checked_orientations:[],assumptions:F,tolerance_mm:c,showVisualization:!0,reason:R.reason,proofSteps:t,...i?{multiItem:i,items:a}:{},itemDims_mm:1===C.length&&C[0]?{length:C[0].length,width:C[0].width,height:C[0].height}:void 0,spaceDims_mm:{length_mm:n.length,width_mm:n.width,height_mm:n.height},...!d&&{spaceDims_raw_mm:{length_mm:e.length,width_mm:e.width,height_mm:e.height}},details:R},{items:C,effectiveContainer:n,rawContainer:e,config:{...m,clearance_mm:c,is_internal:d,wall_thickness_mm:_}})}let A=function(e,t){let n=[];if(!e.length||!e.width||!e.height){let t=[];e.length||t.push("length"),e.width||t.push("width"),e.height||t.push("height"),n.push("Container requires internal L/W/H. Missing: ".concat(t.join(", ")))}return t.forEach((e,t)=>{if(!e.length||!e.width||!e.height){let i=[];e.length||i.push("length"),e.width||i.push("width"),e.height||i.push("height"),n.push("Item ".concat(t+1," requires L/W/H. Missing: ").concat(i.join(", ")))}}),n}(n,C);if(A.length>0)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"dimension_validation",limiting_constraint:"missing_dimensions",checked_orientations:[],assumptions:F,tolerance_mm:c,needs_user_input:A,showVisualization:!0,cta:"Clarify the following for better accuracy, or continue to view 3D with our estimates"};
1if(w&&F.push("Only checking orientations where the item is ".concat({upright:"upright",flat:"flat",on_side:"on its side"}[w]||w," (as requested).")),l=1===C.length?function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=I(e,t,a,r);if(l._noValidOrientation){let i=u({itemDims:[e.length||0,e.width||0,e.height||0],containerDims:[t.length||0,t.width||0,t.height||0],fits:!1,tolerance_mm:2}),a=i.find(e=>!0===e.limiting),o=a?a.comparison.margin_mm:-1;return{verdict:"DOESNT_FIT",margin_mm:i.length>0?o:-1,confidence:"HIGH",method:"single_item_rotation_check",packing_strategy_used:"single_item_all_orientations",search_space_exhausted:!0,limiting_constraint:"no_valid_orientation_after_path_constraints",tightestPoint:{entityA:"item",entityB:"container",axis:"unknown",clearance_mm:i.length>0?o:-1},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["item_rigid"],...i.length>0&&{proofSteps:i},itemDims_mm:{length:e.length,width:e.width,height:e.height},spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},checked_orientations:[],assumptions:[...n,"No valid orientation after path constraints (allowedOrientations filter)"],tolerance_mm:2,showVisualization:!0,details:{reason:"No valid orientation after allowedOrientations filter"}}}if(l.fits){let a=l.minMargin,{verdict:r}=(0,o.K8)(a),m=T(l.orientation,e),c=l.orientation,d=l.margins,u=S(d),_=h({item:{length:e.length,width:e.width,height:e.height},container:{length:t.length,width:t.width,height:t.height},orientation:{l:c.l,w:c.w,h:c.h},margins:{length:d.length,width:d.width,height:d.height},fits:!0});if(e&&"cylinder"===e.shape&&(e.diameter_mm||e.diameter)){let n=e.diameter_mm||e.diameter,i=[[t.length,t.width],[t.length,t.height],[t.width,t.height]].map(e=>{let[t,n]=e;return{w:Math.min(t,n),h:Math.max(t,n)}}).reduce((e,t)=>e.w<t.w?e:t);_.push((0,s.pH)({diameter_mm:n,opening_w_mm:i.w,opening_h_mm:i.h,note:"Cylindrical item — limiting opening is the smallest container face cross-section."}))}let g="true"===v.env.IRREGULAR_GEOMETRY_LIVE&&e&&"l_shape"===e.shape&&Array.isArray(e.footprint)&&2===e.footprint.length;if(g){let n=(0,s.mp)(e.footprint);_.push((0,s.Gv)({footprint_area_mm2:n,room_area_mm2:t.length*t.width,note:"L-shape footprint vs container floor."}));let a=Math.round(e.length*e.width);i.U.log("[IRREGULAR-FOOTPRINT]",JSON.stringify({solver:"container",bbox_mm2:a,footprint_mm2:n,shrink_pct:a>0?Math.round((1-n/a)*100):0,container_floor_mm2:Math.round(t.length*t.width)}))}let p=l.attemptHistory&&l.attemptHistory.length>1?"Chose orientation ".concat(m," because it maximises the smallest axis margin (limiting axis shown at Step ").concat("length"===u?1:"width"===u?2:3,")."):null;return{verdict:r,margin_mm:Math.round(a),confidence:"HIGH",method:"single_item_rotation_check",limiting_constraint:S(l.margins),proofSteps:_,orientationRationale:p,itemDims_mm:{length:e.length,width:e.width,height:e.height},spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},tightestPoint:{entityA:"item_".concat(S(l.margins)),entityB:"container_".concat(S(l.margins)),axis:S(l.margins),clearance_mm:Math.round(a)},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["item_rigid"],checked_orientations:(l.attemptHistory||[]).map(e=>({orientation:"".concat(e.orientation.l,"\xd7").concat(e.orientation.w,"\xd7").concat(e.orientation.h,"mm"),label:e.label,dimensions_mm:{length:e.orientation.l,width:e.orientation.w,height:e.orientation.h},feasible:e.fits,margin_mm:e.fits?e.margin_mm:-Math.round(Math.max(Math.max(0,e.orientation.l-t.length),Math.max(0,e.orientation.w-t.width),Math.max(0,e.orientation.h-t.height))),length_clearance_mm:Math.round(t.length-e.orientation.l),width_clearance_mm:Math.round(t.width-e.orientation.w),height_clearance_mm:Math.round(t.height-e.orientation.h),rejection_reason:e.fits?null:S({length:Math.max(0,e.orientation.l-t.length),width:Math.max(0,e.orientation.w-t.width),height:Math.max(0,e.orientation.h-t.height)})})),assumptions:g?[...n,"Modeled as its L-shaped footprint (two rectangles), not its bounding box."]:n,tolerance_mm:2,showVisualization:!0,packing_strategy_used:"single_item_all_orientations",search_space_exhausted:!0,details:{item_orientation:l.orientation,margins:l.margins,bestOrientation:l.orientation,originalDimensions:{length:e.length,width:e.width,height:e.height},orientationLabel:m,tiltAngle:0,attemptHistory:l.attemptHistory||[],rotationNeeded:"Upright"!==m?m.toLowerCase():null}}}let m=l.closestMiss,c=m?Math.max(m.violations.length,m.violations.width,m.violations.height):0,d=null==m?void 0:m.orientation,_=(null==m?void 0:m.violations)&&d?{length:Math.round(t.length-(d.l||0)),width:Math.round(t.width-(d.w||0)),height:Math.round(t.height-(d.h||0))}:null;m&&k(m.violations);let g=d&&_?h({item:{length:e.length,width:e.width,height:e.height},container:{length:t.length,width:t.width,height:t.height},orientation:{l:d.l,w:d.w,h:d.h},margins:{length:_.length,width:_.width,height:_.height},fits:!1}):null;return{verdict:"DOESNT_FIT",margin_mm:-Math.round(c),confidence:"HIGH",method:"single_item_rotation_check",packing_strategy_used:"single_item_all_orientations",search_space_exhausted:!0,limiting_constraint:m?k(m.violations):"all_orientations_exceeded",tightestPoint:{entityA:m?"item_".concat(k(m.violations)):"item_dimension",entity
1B:m?"container_".concat(k(m.violations)):"container_dimension",axis:m?k(m.violations):"unknown",clearance_mm:-Math.round(c)},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["item_rigid"],...g&&{proofSteps:g},itemDims_mm:{length:e.length,width:e.width,height:e.height},spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},checked_orientations:(l.attemptHistory||[]).map(e=>({orientation:"".concat(e.orientation.l,"\xd7").concat(e.orientation.w,"\xd7").concat(e.orientation.h,"mm"),label:e.label,dimensions_mm:{length:e.orientation.l,width:e.orientation.w,height:e.orientation.h},feasible:e.fits,margin_mm:e.fits?e.margin_mm:-Math.round(Math.max(Math.max(0,e.orientation.l-t.length),Math.max(0,e.orientation.w-t.width),Math.max(0,e.orientation.h-t.height))),length_clearance_mm:Math.round(t.length-e.orientation.l),width_clearance_mm:Math.round(t.width-e.orientation.w),height_clearance_mm:Math.round(t.height-e.orientation.h),rejection_reason:e.fits?null:k({length:Math.max(0,e.orientation.l-t.length),width:Math.max(0,e.orientation.w-t.width),height:Math.max(0,e.orientation.h-t.height)})})),assumptions:n,tolerance_mm:2,showVisualization:!0,details:m?{closest_orientation:m.orientation,violations:m.violations,originalDimensions:{length:e.length,width:e.width,height:e.height},attemptHistory:l.attemptHistory||[]}:void 0}}(C[0],n,F,w,void 0!==N?N:null):2===C.length?function(e,t,n){let i=function(e,t,n){let i={l:e.length,w:e.width,h:e.height},a=null,o=-1/0,r=1/0,l=null,s=y(t),m=y(n);for(let e of s)for(let t of m){{let n=Math.max(e.l,t.l),s=e.w+t.w,m=Math.max(e.h,t.h);if(n<=i.l&&s<=i.w&&m<=i.h){let r=Math.min(i.l-n,i.w-s,i.h-m);r>o&&(o=r,a={fits:!0,strategy:"side_by_side_width",placements:[{item:"A",position:{x:0,y:0,z:0},orientation:e},{item:"B",position:{x:0,y:e.w,z:0},orientation:t}],margins:{length:i.l-n,width:i.w-s,height:i.h-m}})}else{let e=Math.max(0,n-i.l),t=Math.max(0,s-i.w),a=Math.max(0,m-i.h),o=e+t+a;o<r&&(r=o,l={strategy:"side_by_side_width",violation_mm:-Math.max(e,t,a)})}}{let n=e.l+t.l,s=Math.max(e.w,t.w),m=Math.max(e.h,t.h);if(n<=i.l&&s<=i.w&&m<=i.h){let r=Math.min(i.l-n,i.w-s,i.h-m);r>o&&(o=r,a={fits:!0,strategy:"side_by_side_length",placements:[{item:"A",position:{x:0,y:0,z:0},orientation:e},{item:"B",position:{x:e.l,y:0,z:0},orientation:t}],margins:{length:i.l-n,width:i.w-s,height:i.h-m}})}else{let e=Math.max(0,n-i.l),t=Math.max(0,s-i.w),a=Math.max(0,m-i.h),o=e+t+a;o<r&&(r=o,l={strategy:"side_by_side_length",violation_mm:-Math.max(e,t,a)})}}{let n=Math.max(e.l,t.l),s=Math.max(e.w,t.w),m=e.h+t.h;if(n<=i.l&&s<=i.w&&m<=i.h){let r=Math.min(i.l-n,i.w-s,i.h-m);r>o&&(o=r,a={fits:!0,strategy:"stacked_height",placements:[{item:"A",position:{x:0,y:0,z:0},orientation:e},{item:"B",position:{x:0,y:0,z:e.h},orientation:t}],margins:{length:i.l-n,width:i.w-s,height:i.h-m}})}else{let e=Math.max(0,n-i.l),t=Math.max(0,s-i.w),a=Math.max(0,m-i.h),o=e+t+a;o<r&&(r=o,l={strategy:"stacked_height",violation_mm:-Math.max(e,t,a)})}}}return a||{fits:!1,strategy:null,placements:null,bestViolation:l}}(t,e[0],e[1]);if(i.fits){let a=Math.min(i.margins.length,i.margins.width,i.margins.height),{verdict:r}=(0,o.K8)(a);return{verdict:r,margin_mm:Math.round(a),confidence:"HIGH",method:"two_item_joint_packing",packing_strategy_used:i.strategy,search_space_exhausted:!0,limiting_constraint:S(i.margins),checked_orientations:i.placements.map(e=>({orientation:"".concat(e.orientation.l,"\xd7").concat(e.orientation.w,"\xd7").concat(e.orientation.h,"mm"),dimensions_mm:{length:e.orientation.l,width:e.orientation.w,height:e.orientation.h},feasible:!0,margin_mm:Math.round(a),position:e.position})),assumptions:n,tolerance_mm:2,showVisualization:!0,...M(e,t,{packed:!0}),spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},details:{strategy:i.strategy,placements:i.placements,margins:i.margins}}}let a=i.bestViolation;return{verdict:"LIKELY_DOESNT_FIT",margin_mm:a?a.violation_mm:-1,confidence:"MEDIUM",method:"two_item_joint_packing_axis_aligned",packing_strategy_used:"axis_aligned_exhaustive",search_space_exhausted:!1,limiting_constraint:"no_axis_aligned_placement_found",checked_orientations:[],assumptions:[...n,"Checked 3 axis-aligned strategies (side-by-side length/width, stacked height)","Non-orthogonal placement was not tested and might work"],tolerance_mm:2,showVisualization:!0,...M(e,t,{packed:!1}),spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},details:{closest_strategy:(null==a?void 0:a.strategy)||"none",reason:"All axis-aligned packing strategies exceeded container dimensions"},recommendation:"Items may fit with creative angled placement - try physically if dimensions are close"}}(C,n,F):function(e,t){var n,i,a,l;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n=0;n<e.length;n++){let i=I(e[n],t);
1if(!i.fits)return{verdict:"DOESNT_FIT",margin_mm:i.closestMiss?-Math.max(i.closestMiss.violations.length,i.closestMiss.violations.width,i.closestMiss.violations.height):-1,confidence:"HIGH",method:"multi_item_individual_check",limiting_constraint:"item_".concat(n+1,"_too_large"),checked_orientations:[],assumptions:s,tolerance_mm:2,showVisualization:!0,reason:"Item ".concat(n+1," alone exceeds container dimensions"),...M(e,t,{packed:!1}),itemDims_mm:e[n]?{length:e[n].length,width:e[n].width,height:e[n].height}:void 0,spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},details:{failing_item:n+1,item_dimensions:e[n],container_dimensions:t}}}let m=e.reduce((e,t)=>e+t.length*t.width*t.height,0),c=t.length*t.width*t.height;m>c&&(M(e,t,{packed:!1}),t.length,t.width,t.height);let d=m/c,h=Math.ceil(t.length/10)*Math.ceil(t.width/10)<=4e4?(0,r.U)(e.map(e=>({width_mm:e.width,depth_mm:e.length,height_mm:e.height,name:e.name})),{length_mm:t.length,width_mm:t.width,height_mm:t.height}):{packed:!1};if(h.packed){let n=[{axis:"length",clear:h.clearancePerAxis.length_mm,space:t.length},{axis:"width",clear:h.clearancePerAxis.width_mm,space:t.width},{axis:"height",clear:h.clearancePerAxis.height_mm,space:t.height}].reduce((e,t)=>t.clear<e.clear?t:e),i=n.clear,a={packed_l_mm:Math.round(h.maxUsedLength),packed_w_mm:Math.round(h.maxUsedWidth),packed_h_mm:Math.round(h.maxUsedHeight),space_l_mm:Math.round(t.length),space_w_mm:Math.round(t.width),space_h_mm:Math.round(t.height),clearance_mm:Math.round(i),binding_axis:n.axis,binding_space_mm:Math.round(n.space)},{verdict:r}=(0,o.K8)(i);return{verdict:r,margin_mm:Math.round(i),marginBasis:"packed_arrangement",confidence:"HIGH",method:"multi_item_bin_pack",packing_strategy_used:"bin_pack_3d",search_space_exhausted:!0,limiting_constraint:"packed_arrangement_clearance",checked_orientations:[],assumptions:[...s,"All ".concat(e.length," items fit individually"),"A real 3D arrangement places all ".concat(e.length," items in the container at once"),"Combined volume is ".concat(Math.round(100*d),"% of container capacity")],tolerance_mm:2,showVisualization:!0,...M(e,t,{packed:!0,fillRatio:d,packedGeometry:a}),jointPacking:{packed:!0,placements:h.placements,clearancePerAxis:h.clearancePerAxis,spaceUsed:{length_mm:h.maxUsedLength,width_mm:h.maxUsedWidth,height_mm:h.maxUsedHeight}},spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},details:{item_count:e.length,total_volume_mm3:m,container_volume_mm3:c,fill_percentage:Math.round(100*d),packing_strategy:"bin_pack_3d",placements:h.placements}}}let u=M(e,t,{packed:null}),_=u.proofSteps.find(e=>!0===e.limiting&&null!=e.itemIndex);return{verdict:"LIKELY_FITS",margin_mm:_&&null!=(l=null!=(a=null==(n=_.comparison)?void 0:n.margin_mm)?a:null==(i=_.values)?void 0:i.margin_mm)?l:0,marginBasis:"binding_item_axis",confidence:"LOW",method:"multi_item_volume_heuristic",packing_strategy_used:"volume_heuristic",search_space_exhausted:!1,limiting_constraint:"complex_packing_required",checked_orientations:[],assumptions:[...s,"All ".concat(e.length," items fit individually"),"Combined volume is ".concat(Math.round(100*d),"% of container capacity"),"Volume check only — actual fit depends on item arrangement","Exact packing arrangement not computed (3+ items)"],tolerance_mm:2,showVisualization:!0,...u,spaceDims_mm:{length_mm:t.length,width_mm:t.width,height_mm:t.height},details:{item_count:e.length,total_volume_mm3:m,container_volume_mm3:c,fill_percentage:Math.round(100*d)},recommendation:"For 3+ items, physical trial packing is recommended to verify fit"}}(C,n,F),d||(l.spaceDims_raw_mm={length_mm:e.length,width_mm:e.width,height_mm:e.height}),"clamshell"===f&&("FITS"===l.verdict||"FITS_TIGHT"===l.verdict||"FITS_VERY_TIGHT"===l.verdict)){let e=function(e,t,n){var i,a;let o=[{axis:"length",value:e.length},{axis:"width",value:e.width},{axis:"height",value:e.height}];o.sort((e,t)=>e.value-t.value);let r=o[0].axis,l=o[0].value/2;if(1===t.length&&(null==(i=n.details)?void 0:i.item_orientation)){let e=n.details.item_orientation,t="length"===r?e.l:"width"===r?e.w:e.h;if(t>l)return{closureAxis:r,halfDepth_mm:Math.round(l),itemDim_mm:Math.round(t),excess_mm:Math.round(t-l)}}else if(null==(a=n.details)?void 0:a.placements)for(let e of n.details.placements){let t=e.orientation,n="length"===r?t.l:"width"===r?t.w:t.h;if(n>l)return{closureAxis:r,halfDepth_mm:Math.round(l),itemDim_mm:Math.round(n),excess_mm:Math.round(n-l)}}return null}(n,C,l);e&&(l.verdict="FITS_WONT_CLOSE",l.closureType="clamshell",l.closureDetail=e,l.assumptions=[...l.assumptions,"Clamshell container: usable depth per half ≈ ".concat(e.halfDepth_mm,"mm (closure axis: ").concat(e.closureAxis,")")])}if(("lid"===f||"clamshell"===f)&&l.enrichedAssumptions&&l.enrichedAssumptions.push("lid_closes_flat"),l.closureType=l.closureType||f,"FITS_WONT_CLOSE"===l.verdict&&l.closureDetail&&(l.closureGap_mm=l.closureDetail.excess_mm),p&&l.verdict){let e=(0,a.XH)(p,l.verdict);if(e!==l.verdict){l.verdict=e,l.assumptions=[...l.assumptions,"Verdict adjusted from confident to uncertain due to inferred dimensions"];let t=(0,a.Gg)(p);t<.5?l.confidence="LOW":t<.8&&(l.confidence="MEDIUM")}
1}if(!d&&!E&&"number"==typeof l.margin_mm&&Math.abs(l.margin_mm)<=2*_){let e=D(_),t=l.margin_mm<0&&("DOESNT_FIT"===l.verdict||"LIKELY_DOESNT_FIT"===l.verdict),n="Are the container dimensions internal (inside) or external (outside)?";t?(l.warnings=[...l.warnings||[],"Treated container dimensions as external and subtracted ".concat(e," per side for wall thickness — that reduction is what pushed this past the limit. ").concat(n)],"HIGH"===l.confidence&&(l.confidence="MEDIUM")):l.warnings=[...l.warnings||[],"Treated container dimensions as external and subtracted ".concat(e," per side for wall thickness. ").concat(n)],l.needs_user_input=[...l.needs_user_input||[],"Are the container dimensions internal (inside) or external (outside)?"],l.wallThicknessAssumptionAmbiguous=!0}return b(l,{items:C,effectiveContainer:n,rawContainer:e,config:{...m,clearance_mm:c,is_internal:d,wall_thickness_mm:_}}),l.queryType="container_fit",l}},65964:(e,t,n)=>{function i(e){switch(e){case"user_provided":case"user":return"measured";case"db_exact":case"catalog":case"local_db":case"database":case"moving_class_catalog":case"exact_merchant":return"known";case"preset":case"estimated_merchant_approved":case"package_fallback":case"db_fuzzy":case"llm_estimated":case"llm_estimate":case"estimate":case"estimated":case"default":case"heuristic":case"standard dimensions":case"standard_sizes":case"room_scan":case"researched":case"solver":case"last_resort_fallback":case"followup_synthesized":case"url_scrape":case"web_extraction":case"supabase_cache":case"estimate_table":case"llm_fallback":return"estimated";default:return"unknown"}}n.d(t,{Nz:()=>o,Sf:()=>i}),n(30400),n(84126);let a="unknown";function o(e){let t=String((null==e?void 0:e.item_class)||"unknown").toLowerCase(),n=String((null==e?void 0:e._disassemblyType)||(null==e?void 0:e.disassemblyType)||"").toLowerCase(),i={legsRemovable:a,modular:a,disassemblable:a,hasFeet:a,hasDoor:a};switch(t){case"furniture":i.legsRemovable="legs_removed"===n||a,i.modular="sectional"===n||a,i.disassemblable=!!["flatpack","comes_apart","sectional","headboard","legs_removed"].includes(n)||a,i.hasFeet=a,i.hasDoor=a;break;case"appliance":i.legsRemovable=!1,i.modular=!1,i.disassemblable=a,i.hasFeet=a,i.hasDoor=!0;break;case"box":i.legsRemovable=!1,i.modular=!1,i.disassemblable=a,i.hasFeet=!1,i.hasDoor=!1;break;case"person":case"vehicle":i.legsRemovable=!1,i.modular=!1,i.disassemblable=!1,i.hasFeet=!1,i.hasDoor="vehicle"===t}let o=Array.isArray(null==e?void 0:e.parsedItems)&&e.parsedItems[0]||(null==e?void 0:e.parsedPassageItem)||(null==e?void 0:e.parsedRoomItem)||(null==e?void 0:e.parsedElevatorItem)||null;return o&&!0===o.separable&&(i.modular=!0,i.disassemblable=!0),(null==e?void 0:e.itemImpliesMultiPiece)===!0&&(i.modular=!0,i.disassemblable=!0),i}},66167:(e,t,n)=>{n.d(t,{c:()=>m});var i=n(91027),a=n(33403),o=n(49931),r=n(19817);let l={exceeded:"DOESNT_FIT",near:"FITS_TIGHT",ok:"FITS"};function s(e,t){return{verdict:"CLARIFY",loadKind:null,advisory:!1,weightKnown:!1,confidence:"LOW",reason:e,clarifyPrompt:t,assumptions:[],warnings:[],needs_user_input:[t],proofSteps:[]}}function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var m,h,u,_,g,p,f,w,v;let{weight_kg:b,weightKnown:y}=function(e){if(!e)return{weight_kg:null,weightKnown:!1};if("number"==typeof e.weight_kg&&e.weight_kg>0&&e.weightProvided)return{weight_kg:e.weight_kg,weightKnown:!0};if(e.weight&&"number"==typeof e.weight.value){let t=(0,r.z)(e.weight.value,e.weight.unit||"lb");if(null!=t&&t>0)return{weight_kg:t,weightKnown:!0}}return{weight_kg:(0,i.i0)(e),weightKnown:!1}}(e),T=function(e){if(!e||!e.type)return null;let t=String(e.type).toLowerCase();return"elevator"===t?"elevator":"floor"===t||"structural"===t?"floor":"carry"===t||"handling"===t?"carry":"vehicle"===t||"truck"===t||"car"===t?"vehicle":"shelf"===t||"surface"===t||"truck_bed"===t?"surface":null}(t);if(!T)return s("no_space","Which elevator or floor — passenger or freight?");if(null==b)return s("no_weight","Roughly what does it weigh?");let I=(0,r.c)(b,{approximate:!y});if("elevator"===T){let{ratedCapacityKg:e,cabClass:n}=function(e){let t=((null==e?void 0:e.kind)||(null==e?void 0:e.elevatorType)||(null==e?void 0:e.cabClass)||"passenger").toLowerCase();return{ratedCapacityKg:(a.wf[t]||a.wf.passenger).rated_capacity_kg,cabClass:a.wf[t]?t:"passenger"}}(t),s=(0,i.Ty)({weight_kg:b,weightKnown:y,rated_capacity_kg:e,contextLabel:"the ".concat(n," elevator")}),c=null!=(m=null==s?void 0:s.status)?m:"ok";return{verdict:y?null!=(h=l[c])?h:"FITS":"UNKNOWN",loadKind:"elevator",weightKnown:y,advisory:!y,ratedCapacityKg:e,cabClass:n,weight_kg:b,ratio:null!=(u=null==s?void 0:s.ratio)?u:null,margin_mm:null,margin:(0,o.lk)(null),note:null!=(_=null==s?void 0:s.note)?_:null,confidence:y?"HIGH":"MEDIUM",assumptions:[(null==t?void 0:t.kind)?null:"Assumed a ".concat(n," elevator (~").concat((0,r.c)(e)," limit)."),y?null:"Weight is an estimate (~".concat(I,").")].filter(
1Boolean),warnings:[],needs_user_input:[],proofSteps:function(e){let{weightDisp:t,weight_kg:n,ratedCapacityKg:i,status:a,weightKnown:o,cabClass:l}=e,s=Math.round(n*d),m=Math.round(i*d);return[{id:"weight_inequality",passed:"exceeded"!==a,limiting:!0,values:{total_weight_lb:s,limit_lb:m,headroom_lb:m-s,basis:o?"user-provided":"estimated"},note:"".concat(t," vs the ").concat(l," elevator's ~").concat((0,r.c)(i)," rating.")}]}({weightDisp:I,weight_kg:b,ratedCapacityKg:e,status:c,weightKnown:y,cabClass:n})}}if("floor"===T){let t=(null!=(g=e.width_mm)?g:0)*(null!=(p=e.depth_mm)?p:0)||null,n=(0,i.Pg)(b,t);return c("floor",{weight_kg:b,weightKnown:y,weightDisp:I,note:null!=(f=null==n?void 0:n.note)?f:"Within typical residential floor guidance.",floorSeverity:null!=(w=null==n?void 0:n.severity)?w:null,floorPressureKpa:null!=(v=null==n?void 0:n.pressure_kpa)?v:null,extraWarning:"General guidance, not a structural assessment — confirm posted limits with building management."})}if("carry"===T){let e=(0,i.dg)(b,n.difficultyTier||"moderate");return c("carry",{weight_kg:b,weightKnown:y,weightDisp:I,peopleCount:e,note:e?"Plan on ~".concat(e," ").concat(1===e?"person":"people"," to carry ~").concat(I,"."):null})}return c(T,{weight_kg:b,weightKnown:y,weightDisp:I,note:"vehicle"===T?"~".concat(I," — vehicle payload limits aren't in our data; check the manufacturer's rating."):"~".concat(I," concentrated load — use a spreader on soft surfaces.")})}catch(e){return{verdict:"UNKNOWN",loadKind:null,advisory:!0,weightKnown:!1,confidence:"LOW",reason:"load_capacity_error: ".concat(e.message),assumptions:[],warnings:[],needs_user_input:[],proofSteps:[]}}}function c(e,t){var n,i,a,r;return{verdict:"vehicle"===e||"surface"===e?"UNKNOWN":"FITS",loadKind:e,weightKnown:t.weightKnown,advisory:!0,weight_kg:t.weight_kg,margin_mm:null,margin:(0,o.lk)(null),note:null!=(n=t.note)?n:null,floorSeverity:null!=(i=t.floorSeverity)?i:null,floorPressureKpa:null!=(a=t.floorPressureKpa)?a:null,peopleCount:null!=(r=t.peopleCount)?r:null,confidence:t.weightKnown?"MEDIUM":"LOW",assumptions:t.weightKnown?[]:["Weight is an estimate (~".concat(t.weightDisp,").")],warnings:t.extraWarning?[t.extraWarning]:[],needs_user_input:[],proofSteps:[]}}let d=1/.45359237},66884:(e,t,n)=>{n.d(t,{yU:()=>a,ze:()=>i});let i=Object.freeze({IDLE:"idle",PENDING:"pending",STREAMING:"streaming",COMPLETE:"complete",ERROR:"error",ABORTED:"aborted",FALLBACK_USED:"fallback_used"});function a(e){if(!e||"object"!=typeof e)return e;let t=e.explainStatus;return t!==i.PENDING&&t!==i.STREAMING||e.numberFreeExplainText?e:{...e,explainStatus:i.FALLBACK_USED,explainRegenerable:!0}}Object.freeze(["stash_miss","invalid_input","anthropic_error","timeout","session_unresolved","decode_error"])},69111:(e,t,n)=>{n.d(t,{B:()=>g,n:()=>_});var i=n(95155),a=n(12115),o=n(99776),r=n(22454),l=n(6214),s=n(61378),m=n(52414),c=n(68505);let d={byUser:e=>["tokenBalance",e]},h=(0,a.createContext)(null),u={balance:null,fitChecks:null,visualProofs:0,isUnlimited:!1,lifetimeEarned:null,isLoading:!1,updateBalance:()=>{},fetchBalance:()=>{}};function _(){return(0,a.useContext)(h)||u}function g(e){let{children:t}=e,{balance:n,fitChecks:u,visualProofs:_,isUnlimited:g,lifetimeEarned:p,isLoading:f,updateBalance:w,fetchBalance:v}=function(){var e,t,n,i,h,u,_,g;let{user:p,session:f}=(0,l.As)(),w=(0,o.jE)(),v=(0,a.useMemo)(()=>d.byUser(null==p?void 0:p.id),[null==p?void 0:p.id]),b=(0,r.I)({queryKey:v,queryFn:async()=>{let e=await fetch("/api/tokens?user_id=".concat(p.id),{headers:await (0,s.P)({},null==f?void 0:f.access_token)});if(!e.ok)throw Error("Token fetch failed (".concat(e.status,")"));let t=await e.json();if("number"==typeof t.lifetime_earned)try{(0,c.cT)(c.O3.LIFETIME_EARNED,t.lifetime_earned)}catch(e){}return{balance:"number"==typeof t.balance?t.balance:null,lifetimeEarned:"number"==typeof t.lifetime_earned?t.lifetime_earned:null,visualProofsRemaining:"number"==typeof t.visual_proofs_remaining?t.visual_proofs_remaining:0,isUnlimited:!0===t.is_unlimited}},enabled:!!p&&!p.is_anonymous&&!!f,staleTime:6e4,refetchOnWindowFocus:!0,placeholderData:()=>
1{if(!(0,m.B)())return;let e=(0,c.c7)(c.O3.LIFETIME_EARNED);if(null!=e)return{balance:null,lifetimeEarned:e}}}),y=(0,a.useCallback)(e=>{e&&w.setQueryData(v,t=>{let n={...t||{balance:null,lifetimeEarned:null,visualProofsRemaining:0,isUnlimited:!1}};if("number"==typeof e.balance&&(n.balance=e.balance),"boolean"==typeof e.is_unlimited&&(n.isUnlimited=e.is_unlimited),"number"==typeof e.lifetime_earned){n.lifetimeEarned=e.lifetime_earned;try{(0,c.cT)(c.O3.LIFETIME_EARNED,e.lifetime_earned)}catch(e){}}return"number"==typeof e.visual_proofs_remaining&&(n.visualProofsRemaining=e.visual_proofs_remaining),n})},[w,v]),T=(0,a.useCallback)(()=>b.refetch(),[b]);(0,a.useEffect)(()=>{if(!(0,m.B)())return;let e=e=>y(e.detail);return window.addEventListener("itemfits:tokens-initialized",e),()=>window.removeEventListener("itemfits:tokens-initialized",e)},[y]);let I=null!=(h=null==(e=b.data)?void 0:e.balance)?h:null;return{balance:I,fitChecks:I,visualProofs:null!=(u=null==(t=b.data)?void 0:t.visualProofsRemaining)?u:0,isUnlimited:null!=(_=null==(n=b.data)?void 0:n.isUnlimited)&&_,lifetimeEarned:null!=(g=null==(i=b.data)?void 0:i.lifetimeEarned)?g:null,isLoading:b.isLoading,updateBalance:y,fetchBalance:T}}();return(0,i.jsx)(h.Provider,{value:{balance:n,fitChecks:u,visualProofs:_,isUnlimited:g,lifetimeEarned:p,isLoading:f,updateBalance:w,fetchBalance:v},children:t})}},69486:(e,t,n)=>{n.d(t,{w_:()=>s});var i=n(14103),a=n(82062),o=n(95704);let r=void 0!==o&&!!(o.versions&&o.versions.node),l=null;function s(e){if(!(0,i.G)())try{let t=function(){try{return l?l.getStore():void 0}catch(e){return}}();if(!t||!e||"object"!=typeof e||!(0,a.eC)(e.unit)||!(0,a.Ej)(e.stage))return;if(t.observations.length>=32){t.truncated=!0;return}t.observations.push(e)}catch(e){}}r?import("node:async_hooks").then(e=>{l=new e.AsyncLocalStorage}).catch(()=>{}):Promise.resolve()}
1,70593:(e,t,n)=>{function i(e,t,n){return e*Math.sin(n)+t*Math.cos(n)}function a(e,t){return e-2*t}function o(e,t,n,i){let a=e*Math.cos(t),o=n+i;return{fits:a<=o,forwardProjection_mm:Math.round(a),availableSpace_mm:Math.round(o)}}function r(e,t,n){return e*(1-Math.cos(n))+t/2*Math.sin(n)}function l(e,t,n,i){let a=r(e,t,n);return{fits:a<=i,required_mm:Math.round(a),available_mm:Math.round(i)}}function s(e,t){return e+t/2}function m(e,t,n){let i=e+t/2;return{fits:i<=n,tipArc_mm:Math.round(i),available_mm:Math.round(n)}}function c(e,t,n){let a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=n-2*o,l=t||0;if(l>=r)return{fits:!1,bestAngle_rad:0,maxAngle_rad:0,minProjected_mm:l,margin_mm:r-l,effectiveDoorWidth_mm:r};if(e<=r)return{fits:!0,bestAngle_rad:Math.PI/2,maxAngle_rad:Math.PI/2,minProjected_mm:l,margin_mm:r-e,effectiveDoorWidth_mm:r};let s=Math.sqrt(e*e+t*t),m=Math.atan2(t,e),c=r/s;if(c>=1)a=Math.PI/2;else if((a=Math.asin(c)-m)<=.01)return{fits:!1,bestAngle_rad:0,maxAngle_rad:0,minProjected_mm:l,margin_mm:0,effectiveDoorWidth_mm:r};let d=.9*a,h=i(e,t,d);return{fits:!0,bestAngle_rad:d,maxAngle_rad:a,minProjected_mm:l,margin_mm:r-h,projectedAtAngle_mm:h,effectiveDoorWidth_mm:r,R_mm:s,phi_rad:m}}function d(e,t,n,a,r){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=c(e,t,n,l);if(!s.fits)return null;let m=s.effectiveDoorWidth_mm,d=.01,h=s.maxAngle_rad||s.bestAngle_rad,u=null;for(let n=0;n<20;n++){let n=(d+h)/2,l=o(e,n,a,r),s=i(e,t,n);l.fits&&s<=m?(u=n,d=n):h=n}return u}function h(e){let t=[],{beamLength_mm:n,doorWidth_mm:i,loadClearance_mm:a,effDoorWidth_mm:o,thetaMaxRad:r,thetaOptRad:l,R_mm:s,phi_rad:m,lateralRequired_mm:c,turningRadius_mm:d,spanRatio:h}=e;return null!=i&&null!=a&&null!=o&&t.push({id:"effective_door_width",passed:o>0,values:{door_width_mm:i,v_clear_mm:a,eff_door_width_mm:Math.round(o)}}),null!=i&&null!=a&&null!=n&&null!=r&&t.push({id:"theta_max_entry",passed:r>0,values:{door_width_mm:i,v_clear_mm:a,L_mm:n,theta_max_deg:Math.round(180/Math.PI*r*10)/10}}),null!=s&&null!=m&&null!=o&&null!=l&&t.push({id:"optimal_entry_angle",passed:!0,values:{R_mm:Math.round(s),phi_deg:Math.round(180/Math.PI*m*10)/10,eff_door_width_mm:Math.round(o),theta_opt_deg:Math.round(180/Math.PI*l*10)/10}}),null!=d&&null!=n&&null!=l&&null!=c&&t.push({id:"lateral_clearance_pivot",passed:!0,values:{R_mm:d,L_mm:n,theta_deg:Math.round(180/Math.PI*l*10)/10,lateral_clearance_mm:Math.round(c)}}),null!=h&&null!=n&&null!=i&&t.push({id:"span_ratio",passed:h<=3,values:{L_mm:n,door_width_mm:i,span_ratio:Math.round(100*h)/100}}),t.length>0?t:null}function u(e,t,n){return t<2*n?{margin_mm:.85*e,applied:!0}:{margin_mm:e,applied:!1}}n.d(t,{B9:()=>s,GH:()=>o,OM:()=>h,SJ:()=>a,SM:()=>l,co:()=>d,dn:()=>r,l2:()=>u,u3:()=>i,xV:()=>c,zO:()=>m})}
1,71133:(e,t,n)=>{n.d(t,{Q6:()=>s,oV:()=>l});var i=n(24861);let a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,o=()=>"undefined"!=typeof performance?performance.now():0,r=()=>"undefined"!=typeof document&&document.hidden||!1,l=function(){let e=0;"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{document.hidden&&(e+=1)});let t=new Map;return{beginAction:()=>({t0:o(),epoch:e,hiddenBefore:r()}),actionFromChatTurn(t){let n=i.i.turnStart(t);return n?{t0:n.t0,epoch:e,hiddenBefore:!!n.wasHidden||r()}:null},bind(e,n,i){if(!n||"number"!=typeof n.t0||"string"!=typeof e||!a.test(e)||"string"!=typeof i||!i)return!1;var r=o();for(let[e,n]of t)r-n.t0>12e4&&t.delete(e);return!t.has(e)&&(t.set(e,{t0:n.t0,epoch:n.epoch,hiddenBefore:!!n.hiddenBefore,bsid:i,done:!1}),!0)},discard(e){t.delete(e)},isPending:e=>t.has(e),complete(n){let a=t.get(n);if(!a||a.done)return;a.done=!0,t.delete(n);let l=Math.round(o()-a.t0),s={operation:"vehicle_save",fit_check_result_id:n,bsid:a.bsid};return a.hiddenBefore||a.epoch!==e||r()?(0,i.h)({...s,unmeasurable_reason:"hidden"}):l<0||l>12e4?(0,i.h)({...s,unmeasurable_reason:"clock_anomaly"}):(0,i.h)({...s,perceived_latency_ms:l})}}}();function s(e){var t,n,i;return(null==e?void 0:e.fitCheckId)||(null==e||null==(t=e.parsed)?void 0:t.fitCheckId)||(null==e||null==(n=e.schematicData)?void 0:n.fitCheckId)||(null==e||null==(i=e.solverMetadata)?void 0:i.fitCheckId)||null}},74373:(e,t,n)=>{n.d(t,{iI:()=>i,jA:()=>o});let i={sectional:{modular:!0,tested_basis:"piece",hint:"Sectionals are typically modular and can usually be separated into carried pieces."},couch:{modular:!0,tested_basis:"piece",hint:"Many sofas split into a frame plus removable legs/cushions; some are modular."},mattress:{modular:!1,tested_basis:"assembled",hint:"Mattresses are a single flexible-but-not-shrinkable unit; foam can flex slightly."},tv:{modular:!1,tested_basis:"assembled",hint:"TVs are a single rigid panel; the box is larger than the panel."},fridge:{modular:!1,tested_basis:"assembled",hint:"Refrigerators are rigid one-piece units; doors can sometimes be removed for ~1 in."},dresser:{modular:!1,tested_basis:"assembled",hint:"Dressers are rigid; drawers can be removed to reduce weight, not footprint."},washer_dryer:{modular:!1,tested_basis:"assembled",hint:"Washers/dryers are rigid one-piece appliances."},desk:{modular:!0,tested_basis:"piece",hint:"Many desks disassemble into a top plus legs/frame."},box:{modular:!1,tested_basis:"assembled",hint:"A box is tested as the whole carton."},storage_bin:{modular:!1,tested_basis:"assembled",hint:"Storage bins are tested as the whole bin."}};Object.keys(i);let a={sectional:"sectional","sectional sofa":"sectional","sectional couch":"sectional",couch:"couch",sofa:"couch",settee:"couch",loveseat:"couch",mattress:"mattress",bed:"mattress",tv:"tv",television:"tv",fridge:"fridge",refrigerator:"fridge",dresser:"dresser",bureau:"dresser","washer dryer":"washer_dryer",washer:"washer_dryer",dryer:"washer_dryer",desk:"desk",box:"box",carton:"box","storage bin":"storage_bin",bin:"storage_bin",tote:"storage_bin"};function o(e){if(!e||"string"!=typeof e)return null;let t=e.toLowerCase().trim();return t?a[t]?a[t]:a[/ies$/.test(t)?t.replace(/ies$/,"y"):/(ches|shes|xes|ses)$/.test(t)?t.replace(/es$/,""):/s$/.test(t)&&!/ss$/.test(t)?t.replace(/s$/,""):t]||null:null}},75015:(e,t,n)=>{n.d(t,{h:()=>a});var i=n(95704);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.env,t=e.FACT_LEDGER;return"shadow"===t||"live"===t?t:"off"}},76027:(e,t,n)=>{n.d(t,{Ob:()=>z,Rt:()=>j});var i=n(96703),a=n(85850),o=n(27236);let r=new Set(["gap","ceiling"]),l=new Set(["doorway","opening","gap","entryway"]);function s(e,t){if(null==e||!isFinite(e))return null;switch((t||"").toLowerCase()){case"mm":default:return e;case"cm":return 10*e;case"m":return 1e3*e;case"in":case'"':return 25.4*e;case"ft":case"'":return 304.8*e}}function m(e){let t=e.width_mm||0,n=e.depth_mm||0,i=e.height_mm||0,a=[];return t&&n&&a.push({short:Math.min(t,n),long:Math.max(t,n)}),t&&i&&a.push({short:Math.min(t,i),long:Math.max(t,i)}),n&&i&&a.push({short:Math.min(n,i),long:Math.max(n,i)}),a}function c(e){return[e.width_mm,e.depth_mm,e.height_mm].filter(e=>"number"==typeof e&&e>0).sort((e,t)=>
1e-t)}var d=n(98524),h=n(58950),u=n(45263),_=n(65927),g=n(33403),p=n(4508),f=n(90453),w=n(98478),v=n(66167),b=n(38688),y=n(82273),T=n(45042),I=n(22110),M=n(23033),S=n(50573),k=n(84849),N=n(89609),x=n(70593);let E={counterbalance_forklift:{label:"Standard Warehouse Forklift",turning_radius_mm:2500,width_mm:1100,length_mm:2400,load_clearance_mm:150,max_lift_height_mm:4e3,max_load_kg:2500,dimension_source:"researched"},narrow_aisle_forklift:{label:"Narrow Aisle Forklift",turning_radius_mm:1800,width_mm:900,length_mm:2200,load_clearance_mm:100,max_lift_height_mm:6e3,max_load_kg:1500,dimension_source:"researched"},reach_truck:{label:"Reach Truck",turning_radius_mm:1600,width_mm:950,length_mm:2100,load_clearance_mm:100,max_lift_height_mm:9e3,max_load_kg:1800,dimension_source:"researched"},pallet_jack:{label:"Pallet Jack",turning_radius_mm:1200,width_mm:700,length_mm:1800,load_clearance_mm:75,max_lift_height_mm:null,max_load_kg:2e3,dimension_source:"researched"},walkie_stacker:{label:"Walkie Stacker",turning_radius_mm:1400,width_mm:800,length_mm:1900,load_clearance_mm:75,max_lift_height_mm:3e3,max_load_kg:1200,dimension_source:"researched"},hand_dolly:{label:"Hand Dolly",turning_radius_mm:600,width_mm:500,length_mm:600,load_clearance_mm:50,max_lift_height_mm:null,max_load_kg:250,dimension_source:"estimated"},hand_truck:{label:"Hand Truck",turning_radius_mm:500,width_mm:450,length_mm:500,load_clearance_mm:50,max_lift_height_mm:null,max_load_kg:150,dimension_source:"estimated"},platform_cart:{label:"Platform Cart",turning_radius_mm:800,width_mm:600,length_mm:1200,load_clearance_mm:50,max_lift_height_mm:null,max_load_kg:500,dimension_source:"estimated"},furniture_dolly:{label:"Furniture Dolly",turning_radius_mm:700,width_mm:450,length_mm:750,load_clearance_mm:50,max_lift_height_mm:null,max_load_kg:350,dimension_source:"estimated"}},D={forklift:"counterbalance_forklift","fork lift":"counterbalance_forklift","narrow aisle":"narrow_aisle_forklift","reach truck":"reach_truck","pallet jack":"pallet_jack","walkie stacker":"walkie_stacker",dolly:"hand_dolly","hand truck":"hand_truck","hand cart":"platform_cart",cart:"platform_cart",trolley:"platform_cart","furniture dolly":"furniture_dolly"};function F(e){if(!e)return{equipment:{...E.counterbalance_forklift,equipment_type:"counterbalance_forklift"},resolution:"default"};let t=e.toLowerCase().trim();if(E[t])return{equipment:{...E[t],equipment_type:t},resolution:"class_template"};if(D[t]){let e=D[t];return{equipment:{...E[e],equipment_type:e},resolution:"class_template"}}for(let[e,n]of Object.entries(D))if(t.includes(e)||e.includes(t))return{equipment:{...E[n],equipment_type:n},resolution:"class_template"};return{equipment:{...E.counterbalance_forklift,equipment_type:"counterbalance_forklift"},resolution:"default"}}function C(e){return e<=1?"easy":e<=1.5?"moderate":e<=2.5?"difficult":"expert"}function O(e){let{margin_mm:t,equipment:n,hasApproachSpace:i,hasWallDepth:a,spanRatio:o}=e,r=[];return"estimated"===n.dimension_source&&r.push("Equipment dimensions are estimated (not model-specific)"),i||r.push("Approach space not provided — assumed unlimited"),a||r.push("Wall depth 
1not provided — assumed standard 150mm"),null!==t&&t<k.U.margins.UNKNOWN_THRESHOLD&&r.push("Very tight margin (".concat(t,"mm) — analytic formula may be unreliable")),o>2.5&&r.push("High span ratio — result is approximate"),{level:0===r.length?"high":r.length<=2?"medium":"low",reasons:r}}function R(e){return null!=e&&isFinite(e)?Math.round(e):null}function A(e){var t;let n=k.U.margins[e];if(n&&null!=n.VEHICLE_CLEARANCE)return n.VEHICLE_CLEARANCE;let i=k.U.margins.DEFAULT_ENVIRONMENT;return(null==(t=k.U.margins[i])?void 0:t.VEHICLE_CLEARANCE)||150}function L(e){return null==e||e<0?{verdict:"DOESNT_FIT",tone:"definitive"}:e<k.U.margins.UNKNOWN_THRESHOLD?{verdict:"UNKNOWN",tone:"warning"}:e<k.U.margins.TIGHT_THRESHOLD?{verdict:"FITS_TIGHT",tone:"cautious"}:{verdict:"FITS",tone:"confident"}}function P(e){let{axis:t,spaceLimit_mm:n,margin_mm:i,context:o=[]}=e,r=(0,a.rc)({axis:t,spaceLimit_mm:n,margin_mm:i});return 0===r.length?[]:(0,a.ke)([...r,...o||[]])}function U(e,t){let n=[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm].map(e=>Number(e)||0).filter(e=>e>0).sort((e,t)=>e-t);if(0===n.length)return[];let[i=0,o=0,r=0]=n,l=Number(null==t?void 0:t.width_mm)||0,s=Number(null==t?void 0:t.height_mm)||0,m=Math.sqrt(l*l+s*s);return(0,a.kj)({itemFace:{a_mm:i,b_mm:o},spaceFace:{a_mm:l,b_mm:s||null},itemReach:{l_mm:n.length>=3?r:n[n.length-1],w_mm:o,h_mm:i},spaceReachDiag_mm:m,fits:!1})}function H(e,t,n,i){let o=[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm].map(e=>Number(e)||0).filter(e=>e>0).sort((e,t)=>e-t);if(0===o.length)return[];let r=Number(t)||o[0],l=o[o.length-1],s=Number(n)||0,m=Number(i)||0;return(0,a.kj)({itemFace:{a_mm:r,b_mm:r},spaceFace:{a_mm:s,b_mm:m},itemReach:{l_mm:l,w_mm:o[Math.min(1,o.length-1)],h_mm:r},spaceReachDiag_mm:Math.sqrt(s*s+m*m),fits:!1})}function W(e){let{verdict:t,margin_mm:n,method:i=null,angle_deg:a=null,confidence:o,assumptions:r=[],warnings:l=[],equipment:s,resolution:m,environment:c,spanRatio:d=null,difficulty:h=null,lateralRequired_mm:u=null,tipArc_mm:_=null,cornerMaxLength_mm:g=null,forwardCheck:p=null,lateralCheck:f=null,tipArcCheck:w=null,itemDims_mm:v=null,openingDims_mm:b=null,proofSteps:y=null,unknown_reason:T=null}=e,I=function(e){let{angle_deg:t,margin_mm:n,difficulty:i,equipment:a,spanRatio:o,forwardCheck:r,lateralCheck:l,tipArcCheck:s}=e,m=[];return null!=t&&t<90&&m.push("Requires angled entry at ~".concat(Math.round(t),"\xb0")),("difficult"===i||"expert"===i)&&m.push("Skilled operator recommended"),null!=n&&n<k.U.margins.TIGHT_THRESHOLD&&m.push("Only ".concat(Math.round(n),"mm clearance — verify on-site before attempting")),r&&!r.fits&&m.push("Forward projection (".concat(r.forwardProjection_mm,"mm) exceeds available space (").concat(r.availableSpace_mm,"mm)")),l&&!l.fits&&m.push("Lateral space needed for rotation (".concat(l.required_mm,"mm) exceeds available space (").concat(l.available_mm,"mm)")),s&&!s.fits&&m.push("Beam tip sweep arc (".concat(s.tipArc_mm,"mm) exceeds approach space (").concat(s.available_mm,"mm)")),"estimated"===a.dimension_source&&m.push("Using estimated ".concat(a.label," dimensions — verify against your specific equipment")),m}({angle_deg:a,margin_mm:n,difficulty:h,equipment:s,spanRatio:d,forwardCheck:p,lateralCheck:f,tipArcCheck:w});return{verdict:t,unknown_reason:T,margin_mm:n,method:i,confidence:o.level,confidence_reasons:o.reasons,assumptions:r,warnings:l,queryType:"motion",motion_advisory:{required_angle_deg:a,maneuver_difficulty:h,clearance_margin_mm:n,span_ratio:d,notes:I},equipment_used:{type:s.equipment_type,label:s.label,turning_radius_mm:s.turning_radius_mm,width_mm:s.width_mm,load_clearance_mm:s.load_clearance_mm,dimension_source:s.dimension_source,resolution:m},environment:c,_motion:{lateralRequired_mm:u,tipArc_mm:_,cornerMaxLength_mm:g,forwardCheck:p,lateralCheck:f,tipArcCheck:w},itemDims_mm:v||null,openingDims_mm:b||null,spaceDims_mm:b?{door_width_mm:b.width,door_height_mm:b.height}:null,proofSteps:y||null,_constrainingDim_mm:(null==b?void 0:b.width)||null,tightestPoint:{entityA:"vehicle_clearance",entityB:"entry_plane",axis:"width",clearance_mm:n},geometryClass:"motion",enrichedConfidence:o.level,enrichedAssumptions:["beam_horizontal","doorway_unobstructed","approach_path_available"],...null!=a&&a>0&&{maneuverDetail:{requiredAngle_deg:a,approachDistance_mm:u}}}}var G=n(55786),q=n(82734);n(27846),n(89175),n(73169),n(62745);let j={opening:i.wV,hallway:d.C3,stairs:h.Y,turn:u.PU,container:_.GV,elevator:g.YM,vehicle:p.mw,vehicle_multi_space:p.n7,vehicle_multi_item:p.kC,vehicle_multi_item_multi_space:p.Xy,room:f.Cp,room_multi_item:f.Ve,capacity:w.solve
1Capacity,load_capacity:v.c,move_size:b.solveMoveSize,opening_multi_item:q.Ox,container_multi_item:q.NX,elevator_multi_item:q.a6,hallway_multi_item:q.KK,turn_multi_item:q.xT,stairs_multi_item:q.G4,hybrid:y.q3,residual:T.solveResidual,arrangement:I.solveArrangement,comparison:M.solveComparison,optimization:S.solveOptimization,motion:function(e){var t;let{item:n,opening:i,equipmentType:a=null,equipmentOverrides:r=null,approachSpace_mm:l=null,wallDepth_mm:s=null,environment:m=k.U.margins.DEFAULT_ENVIRONMENT}=e,c=[],d=[],{equipment:h,resolution:u}=F(a);r&&(r.turning_radius_mm&&(h.turning_radius_mm=r.turning_radius_mm),r.width_mm&&(h.width_mm=r.width_mm),r.load_clearance_mm&&(h.load_clearance_mm=r.load_clearance_mm)),"default"===u?c.push("Using default ".concat(h.label," dimensions — specify your equipment for more accurate results")):"class_template"===u&&c.push("Using ".concat(h.label," class average dimensions"));let _=Math.max(n.width_mm||0,n.depth_mm||0,n.height_mm||0),g=[(t=n).width_mm||0,t.depth_mm||0,t.height_mm||0].filter(e=>e>0).sort((e,t)=>e-t);if(_<=0)return W({verdict:"UNKNOWN",unknown_reason:o.r.MISSING_ITEM_DIMS,margin_mm:null,confidence:{level:"low",reasons:["No item dimensions provided"]},assumptions:["Cannot compute motion feasibility without item dimensions"],warnings:d,equipment:h,resolution:u,environment:m});let p=i.width_mm||0,f=i.height_mm||0,w={width:n.width_mm||0,depth:n.depth_mm||0,height:n.height_mm||0},v={width:p,height:f},b=e=>W({...e,itemDims_mm:w,openingDims_mm:v});if(p<=0)return b({verdict:"UNKNOWN",unknown_reason:o.r.MISSING_SPACE_DIMS,margin_mm:null,confidence:{level:"low",reasons:["No opening width provided"]},assumptions:["Cannot compute motion feasibility without opening width"],warnings:d,equipment:h,resolution:u,environment:m});if(f>0&&g.length>=2){let e=g[0];if(e>f)return b({verdict:"DOESNT_FIT",margin_mm:R(f-e),proofSteps:P({axis:"door_height",spaceLimit_mm:f,margin_mm:f-e,context:U(n,i)}),confidence:{level:"high",reasons:[]},assumptions:["Item cross-section exceeds opening height — no angle resolves this"],warnings:d,equipment:h,resolution:u,environment:m})}let y=_/p;if(y>k.U.span.MOTION_REQUIRED)return b({verdict:"DOESNT_FIT",margin_mm:R(p-_),proofSteps:P({axis:"door_span",spaceLimit_mm:p,margin_mm:p-_,context:U(n,i)}),confidence:{level:"high",reasons:[]},assumptions:[...c,"Span ratio ".concat(y.toFixed(1)," exceeds practical limit (").concat(k.U.span.MOTION_REQUIRED,":1) — object is too long relative to the opening"),"Consider disassembly, alternative access route, or a wider opening"],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,difficulty:"expert"});let T=p-h.width_mm;if(T<0)return b({verdict:"DOESNT_FIT",margin_mm:R(T),proofSteps:P({axis:"door_span",spaceLimit_mm:p,margin_mm:T,context:U(n,i)}),confidence:{level:"high",reasons:[]},assumptions:[...c,"".concat(h.label," body (").concat(h.width_mm,"mm) is wider than the opening (").concat(p,"mm)")],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y});if(y<=1){let e=Math.min(p-_,T),{verdict:t}=L(e),n=(0,x.OM)({beamLength_mm:_,doorWidth_mm:p,spanRatio:y})||[],i=P({axis:"door_span",spaceLimit_mm:p,margin_mm:e,context:n});return b({verdict:t,margin_mm:R(e),method:"straight",angle_deg:0,confidence:O({margin_mm:e,equipment:h,hasApproachSpace:null!=l,hasWallDepth:null!=s,spanRatio:y}),assumptions:[...c,"Object fits straight through the opening on the vehicle"],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,difficulty:"easy",proofSteps:i})}let I=g.length>=2?g[0]:0,M=h.load_clearance_mm||0,S=(0,x.xV)(_,I,p,M),N=()=>(0,x.OM)({beamLength_mm:_,doorWidth_mm:p,loadClearance_mm:M,effDoorWidth_mm:S.effectiveDoorWidth_mm,thetaMaxRad:S.maxAngle_rad,thetaOptRad:S.bestAngle_rad,R_mm:S.R_mm,phi_rad:S.phi_rad,lateralRequired_mm:Math.round((0,x.dn)(h.turning_radius_mm,_,S.bestAngle_rad)),turningRadius_mm:h.turning_radius_mm,spanRatio:y})||[];if(!S.fits){let e=S.effectiveDoorWidth_mm;return b({verdict:"DOESNT_FIT",margin_mm:R(S.margin_mm),proofSteps:P({axis:"door_span",spaceLimit_mm:S.effectiveDoorWidth_mm,margin_mm:S.margin_mm,context:N()}),confidence:{level:"high",reasons:[]},assumptions:[...c,M>0?"After deducting ".concat(M,"mm load clearance per side, effective opening is ").concat(Math.round(e),"mm"):null,"Even at optimal angle, projection exceeds effective opening width by ".concat(Math.round(Math.abs(S.margin_mm)),"mm")].filter(
1Boolean),warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y})}M>0&&c.push("Load clearance: ".concat(M,"mm per side deducted from opening (effective width: ").concat(Math.round(S.effectiveDoorWidth_mm),"mm)"));let E=180*S.bestAngle_rad/Math.PI,D=S.margin_mm,H=(0,x.l2)(D,p,h.width_mm);H.applied&&(D=H.margin_mm,c.push("Narrow space — 15% safety reduction applied")),D=Math.min(D,T);let G=s||150,q=l||2*_,j=null!=l;s||c.push("Wall depth not specified — assuming standard 150mm"),j||c.push("Approach space not specified — assuming unlimited");let z=(0,x.GH)(_,S.bestAngle_rad,G,q);if(!z.fits){let e=(0,x.co)(_,I,p,G,q,M);if(null===e)return b({verdict:"DOESNT_FIT",margin_mm:R(D),proofSteps:P({axis:"forward_clearance",spaceLimit_mm:z.availableSpace_mm,margin_mm:z.availableSpace_mm-z.forwardProjection_mm,context:N()}),confidence:{level:"medium",reasons:["Forward clearance insufficient at all angles"]},assumptions:[...c,"Forward projection (".concat(z.forwardProjection_mm,"mm) exceeds available space (").concat(z.availableSpace_mm,"mm)")],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,angle_deg:Math.round(E),forwardCheck:z});let t=180*e/Math.PI,n=(0,x.u3)(_,I,e),i=(0,x.SJ)(p,M),a=Math.min(i-n,T),o=C(y),{verdict:r}=L(a),l=(0,x.OM)({beamLength_mm:_,doorWidth_mm:p,loadClearance_mm:M,effDoorWidth_mm:i,R_mm:S.R_mm,phi_rad:S.phi_rad,thetaOptRad:e,turningRadius_mm:h.turning_radius_mm,lateralRequired_mm:Math.round((0,x.dn)(h.turning_radius_mm,_,e)),spanRatio:y})||[];return b({verdict:r,margin_mm:R(a),method:"angled_constrained",proofSteps:P({axis:"door_span",spaceLimit_mm:i,margin_mm:a,context:l}),angle_deg:Math.round(t),confidence:O({margin_mm:a,equipment:h,hasApproachSpace:j,hasWallDepth:null!=s,spanRatio:y}),assumptions:[...c,"Forward clearance limits entry angle to ~".concat(Math.round(t),"\xb0 (max would be ").concat(Math.round(E),"\xb0)")],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,difficulty:o,lateralRequired_mm:Math.round((0,x.dn)(h.turning_radius_mm,_,e)),tipArc_mm:Math.round((0,x.B9)(h.turning_radius_mm,_))})}let V=h.turning_radius_mm,B=null;if(j&&!(B=(0,x.SM)(V,_,S.bestAngle_rad,l)).fits)return b({verdict:"DOESNT_FIT",margin_mm:R(B.available_mm-B.required_mm),proofSteps:P({axis:"lateral_clearance",spaceLimit_mm:B.available_mm,margin_mm:B.available_mm-B.required_mm,context:N()}),confidence:{level:"medium",reasons:["Insufficient lateral space for vehicle rotation"]},assumptions:[...c,"Vehicle rotation requires ".concat(B.required_mm,"mm lateral space but only ").concat(B.available_mm,"mm available"),"The vehicle cannot achieve the required entry angle in the available approach area"],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,angle_deg:Math.round(E),lateralCheck:B});let Y=null;if(j&&!(Y=(0,x.zO)(V,_,l)).fits)return b({verdict:"DOESNT_FIT",margin_mm:R(Y.available_mm-Y.tipArc_mm),proofSteps:P({axis:"tip_arc",spaceLimit_mm:Y.available_mm,margin_mm:Y.available_mm-Y.tipArc_mm,context:N()}),confidence:{level:"medium",reasons:["Beam tip sweep arc exceeds approach space"]},assumptions:[...c,"Beam tip sweeps a ".concat(Y.tipArc_mm,"mm arc during pivot but only ").concat(Y.available_mm,"mm approach space available"),"The beam tip would hit a wall before reaching the required angle — provide more approach space or use a shorter object"],warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,angle_deg:Math.round(E),tipArcCheck:Y});let K=A(m),$=D-K;c.push("".concat(m," safety margin applied: ").concat(K,"mm vehicle clearance deducted"));let X=C(y),{verdict:Q}=L($),J=B?B.required_mm:Math.round((0,x.dn)(V,_,S.bestAngle_rad)),Z=(0,x.OM)({beamLength_mm:_,doorWidth_mm:p,loadClearance_mm:M,effDoorWidth_mm:S.effectiveDoorWidth_mm,thetaMaxRad:S.maxAngle_rad,thetaOptRad:S.bestAngle_rad,R_mm:S.R_mm,phi_rad:S.phi_rad,lateralRequired_mm:J,turningRadius_mm:V,spanRatio:y})||[],ee=P({axis:"door_span",spaceLimit_mm:S.effectiveDoorWidth_mm,margin_mm:$,context:Z});return b({verdict:Q,margin_mm:R($),method:"angled",angle_deg:Math.round(E),confidence:O({margin_mm:$,equipment:h,hasApproachSpace:j,hasWallDepth:null!=s,spanRatio:y}),assumptions:c,warnings:d,equipment:h,resolution:u,environment:m,spanRatio:y,difficulty:X,lateralRequired_mm:J,tipArc_mm:Y?Y.tipArc_mm:Math.round((0,x.B9)(V,_)),forwardCheck:z,lateralCheck:B,tipArcCheck:Y,proofSteps:ee})},motion_corner:function(e){let{item:t,corridorWidths:n,turnAngle:i=90,equipmentType:a=null,equipmentOverrides:r=null,environment:l=k.U.margins.DEFAULT_ENVIRONMENT}=e,s=[],m=[],{equipment:c,resolution:d}=F(a);r&&(r.turning_radius_mm&&(c.turning_radius_mm=r.turning_radius_mm),r.width_mm&&(c.width_mm=r.width_mm)),"default"===d&&s.push("Using default ".concat(c.label," dimensions"));let h=Math.max(t.width_mm||0,t.depth_mm||0,t.height_mm||0),u=Math.min(...[t.width_mm,t.depth_mm,t.height_mm].filter(e=>e>0));if(!n||n.length<2)return W({verdict:"UNKNOWN",unknown_reason:o.r.MISSING_SPACE_DIMS,margin_mm:null,confidence:{level:"low",reasons:["Need both corridor widths for c
1orner check"]},assumptions:[...s,"Corridor widths not provided"],warnings:m,equipment:c,resolution:d,environment:l});let[_,g]=n,p=_-c.width_mm+u,f=g-c.width_mm+u;if(p<=0||f<=0)return W({verdict:"DOESNT_FIT",margin_mm:R(Math.min(p,f)),proofSteps:P({axis:"passage_width",spaceLimit_mm:Math.min(_,g),margin_mm:Math.min(p,f),context:H(t,u,_,g)}),confidence:{level:"high",reasons:[]},assumptions:[...s,"".concat(c.label," body doesn't fit in the corridor")],warnings:m,equipment:c,resolution:d,environment:l});let w=(0,N.fI)(u,p,f);if(null===w)return W({verdict:"DOESNT_FIT",margin_mm:null,margin_unknown_reason:"MARGIN_AMBIGUOUS_CONSTRAINT",proofSteps:P({axis:"passage_width",spaceLimit_mm:Math.min(_,g),margin_mm:null,context:H(t,u,_,g)}),confidence:{level:"high",reasons:[]},assumptions:[...s,"Item cross-section exceeds effective corridor width"],warnings:m,equipment:c,resolution:d,environment:l});let v=180===i?.85*w:w,b=A(l),y=v-h-b,{verdict:T}=L(y);return 180===i&&s.push("U-turn decomposed into two sequential 90\xb0 turns (15% safety factor applied)"),s.push("".concat(l," safety margin applied: ").concat(b,"mm vehicle clearance deducted")),W({verdict:T,margin_mm:R(y),proofSteps:P({axis:"navigable_length",spaceLimit_mm:Math.round(v),margin_mm:y}),method:180===i?"u_turn":"corner_turn",confidence:O({margin_mm:y,equipment:c,hasApproachSpace:!0,hasWallDepth:!0,spanRatio:h/Math.min(_,g)}),assumptions:s,warnings:m,equipment:c,resolution:d,environment:l,spanRatio:h/Math.min(_,g),difficulty:C(h/Math.min(_,g)),cornerMaxLength_mm:Math.round(v)})},tightest_blocker:function(e){var t,n,i,d;let h,{items:u,spaces:_,constraints:g,unresolved:p}=e,f=u||[],w=_||[],v=g||[],b=function(e){let t=0,n=[];for(let i of e||[]){if((null==i?void 0:i.kind)!=="clearance")continue;let e=s(i.value,i.unit);if(null==e||e<=0)continue;t+=e;let a=i.label?" (".concat(i.label,")"):"";n.push("".concat(i.value).concat(i.unit||"mm").concat(a))}return{totalMm:t,descriptors:n}}(v),y=[...function(e,t){let n=[];for(let i of e||[])if(null!=i.width_mm&&i.width_mm>0){let e=t>0&&l.has(i.type),a=e?2*t:0,o=e&&a>=i.width_mm,r=o?0:a,s=Math.max(0,i.width_mm-r);n.push({label:"".concat(i.type," ").concat(i.label||"").trim(),dim_w_mm:s,dim_w_raw_mm:i.width_mm,dim_h_mm:i.height_mm||null,kind:i.type,source_quote:i.source_quote||null,_clearance_take_mm:r,_clearance_implausible:o})}return n}(w,b.totalMm),...function(e,t){let n=[];for(let i of e||[]){if(!r.has(i.kind))continue;let e=s(i.value,i.unit);if(null==e||e<=0)continue;let a=t>0&&"gap"===i.kind,o=a?2*t:0,l=a&&o>=e,m=l?0:o,c=Math.max(0,e-m);n.push({label:"".concat(i.kind," ").concat(i.label||"").trim(),dim_w_mm:c,dim_w_raw_mm:e,dim_h_mm:null,kind:i.kind,source_quote:i.source_quote||null,_clearance_take_mm:m,_clearance_implausible:l})}return n}(v,b.totalMm)];if(0===y.length)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"tightest_blocker",limiting_constraint:"no_spaces",checked_orientations:[],assumptions:["No space or gap dimensions extracted from query"],tolerance_mm:10,showVisualization:!1,queryType:"multi_constraint",needs_user_input:["Space dimensions (width \xd7 height)"]};if(0===f.length)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"tightest_blocker",limiting_constraint:"no_items",checked_orientations:[],assumptions:["No items extracted from query"],tolerance_mm:10,showVisualization:!1,queryType:"multi_constraint",needs_user_input:["Item dimensions (width \xd7 depth \xd7 height)"]};let T=[],I=[];for(let e of f)m(e).length>0?T.push(e):I.push(e);if(0===T.length)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"tightest_blocker",limiting_constraint:"item_missing_dims",checked_orientations:[],assumptions:["All items missing dimensions: ".concat(I.map(e=>e.name||"item").join(", "))],tolerance_mm:10,showVisualization:!1,queryType:"multi_constraint",needs_user_input:I.map(e=>"Dimensions for ".concat(e.name||"item"," (width \xd7 depth \xd7 height)"))};let M=[],S=[],k=null,N=null,x=1/0;for(let e of T){let n=null,i=1/0;for(let t of y){let a=function(e,t){let n=m(e);if(0===n.length)return 0;if(null!=t.dim_h_mm){let e=-1/0;for(let i of n)e=Math.max(e,Math.min(t.dim_w_mm-i.short,t.dim_h_mm-i.long),Math.min(t.dim_w_mm-i.long,t.dim_h_mm-i.short));return e===-1/0?0:e}let i=c(e);if(i.length<2){var a;return t.dim_w_mm-(null!=(a=i[0])?a:0)}let o=i[1];return t.dim_w_mm-o}(e,t);S.push({item:e.name||"item",blocker:t.label,margin_mm:Math.round(a)}),a<i&&(i=a,n=t)}M.push({item:e.name||"item",limiting_blocker:null!=(t=null==n?void 0:n.label)?t:null,margin_mm:Math.round(i),fits:i>=0}),i<x&&(x=i,k=n,N=e)}let E=y.some(e=>
1e._clearance_take_mm>0),D=E?["Applied ".concat((b.totalMm/25.4).toFixed(1),'" clearance per side ')+"(".concat((2*b.totalMm/25.4).toFixed(1),'" total) to ')+"".concat(y.filter(e=>e._clearance_take_mm>0).map(e=>e.label).join(", "))+". Sources: ".concat(b.descriptors.join("; "))]:[],F=b.totalMm>0&&!E?["Clearance extracted (".concat(b.descriptors.join("; "),") but no horizontal aperture to apply it to — ignored.")]:[],C=y.filter(e=>e._clearance_implausible),O=C.length>0?["Ignored an implausible clearance (".concat(b.descriptors.join("; "),") — it would have closed ")+"".concat(C.map(e=>e.label).join(", ")," entirely. Used the real opening width instead. ")+"If you meant an obstacle in the path rather than a per-side margin, describe it as a separate space."]:[],R=[];if(T.length>1){let e=M.filter(e=>!e.fits),t=M.filter(e=>e.fits);if(0===e.length){let e=t.reduce((e,t)=>null==e||t.margin_mm<e.margin_mm?t:e,null);R.push("All ".concat(t.length," items clear every blocker (tightest: ").concat(null==e?void 0:e.item," at ").concat(null==e?void 0:e.limiting_blocker,", ").concat(null==e?void 0:e.margin_mm,"mm margin)."))}else{let n=e.map(e=>"".concat(e.item," at ").concat(e.limiting_blocker," by ").concat(Math.abs(e.margin_mm),"mm")).join("; ");R.push("".concat(e.length," of ").concat(M.length," items fail: ").concat(n,".")),t.length>0&&R.push("".concat(t.length," other item(s) clear all blockers."))}}let A=["Cross-section fit only — does not model path geometry or motion planning.",...D,...F,...O,...R,...I.length>0?["".concat(I.length," item(s) skipped (no dimensions): ")+"".concat(I.map(e=>e.name||"unknown").join(", "),". ")+"Provide dimensions to confirm they fit."]:[],...(null==p?void 0:p.length)?["Unresolved: ".concat(p.join("; "))]:[],...function(e,t){let n=[];for(let i of e){let e=Math.max(i.width_mm||0,i.depth_mm||0,i.height_mm||0);for(let a of t||[])if(null!=a.depth_mm&&a.depth_mm>0&&e>a.depth_mm)return n.push("Cross-section fit only. ".concat(i.name||"item"," longest dimension ")+"(".concat(Math.round(e/25.4),'") exceeds ').concat(a.label||a.type," depth ")+"(".concat(Math.round(a.depth_mm/25.4),'") — rotation inside the space may not be physically possible. ')+"Motion-planning not modeled in v1."),n}return n}(T,w)];if(k&&(null==k.dim_w_mm||k.dim_w_mm<=0))return{verdict:"UNKNOWN",unknown_reason:o.r.MISSING_SPACE_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",confidence:"LOW",method:"tightest_blocker",limiting_constraint:k.label||"degenerate_aperture",checked_orientations:S,assumptions:[...A,"Could not resolve a valid width for ".concat(k.label||"the opening"," — no confident verdict possible.")],tolerance_mm:10,showVisualization:!1,queryType:"multi_constraint",needs_user_input:["A valid width for ".concat(k.label||"the opening")]};h=x<0?"DOESNT_FIT":x<=10?"FITS_VERY_TIGHT":"FITS";let L=T.every(e=>null!=e.source_quote)&&y.every(e=>null!=e.source_quote),P="CLARIFY"===h?"LOW":L&&0===I.length&&Math.abs(x)>25?"HIGH":"MEDIUM",U=[];if(N&&y.length>0){let e=c(N),t=null!=(i=null!=(n=e[Math.min(1,e.length-1)])?n:e[0])?i:0;for(let n of y){let i=null!=n.dim_h_mm?Math.min(n.dim_w_mm,n.dim_h_mm):n.dim_w_mm,a=null!=n.dim_h_mm&&null!=(d=e[0])?d:t;U.push({axis:n.label||n.kind||"blocker",item_mm:a,space_mm:i})}}let H=(0,a.pl)(U);return{verdict:h,margin_mm:Math.round(x),confidence:P,method:"tightest_blocker",limiting_constraint:(null==k?void 0:k.label)||null,limiting_item:(null==N?void 0:N.name)||null,tightest_blocker:k,proofSteps:H,itemDims_mm:N?{length:N.depth_mm||0,width:N.width_mm||0,height:N.height_mm||0}:void 0,spaceDims_mm:k?{width_mm:k.dim_w_mm||0,...null!=k.dim_h_mm&&{height_mm:k.dim_h_mm}}:void 0,per_item_results:M,items_with_dims_count:T.length,items_missing_dims:I.map(e=>e.name||"unknown"),checked_orientations:S,assumptions:A,tolerance_mm:10,showVisualization:!1,queryType:"multi_constraint",needs_user_input:I.length>0?I.map(e=>"Dimensions for ".concat(e.name||"item")):[]}}};function z(){return{...j}}G.R_,G.Pe},77632:(e,t,n)=>{var i;n.d(t,{Bs:()=>m,G5:()=>s});let a={mm:1,cm:10,in:25.4,ft:304.8,m:1e3},o=e=>null!=e;function r(e){let t=e.filter(e=>o(e.value));if(!t.length)return{status:"missing"};if(t.some(e=>{let t;return!("number"==typeof(t=e.value)&&Number.isFinite(t)&&t>0)}))return{status:"invalid",candidates:t};let n=t[0].value;return t.some(e=>Math.abs(e.value-n)>1e-9*Math.max(1,n))?{status:"conflicting",candidates:t}:{status:"resolved",value:n}}let l=(e,t)=>
1o(e)?"number"==typeof e&&a[t]?e*a[t]:NaN:e;function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null!=(i=null==e?void 0:e.unit)?i:"mm";null!=e||(e={});let n={...e},a={};for(let[i,x]of[["cab",["width","depth","height"]],["door",["width","height"]]]){var s,m,c,d,h,u,_,g,p,f,w,v,b,y,T,I,M,S,k,N;let E=null!=(s=e[i])?s:{};for(let s of(n[i]={...E,_accessSources:{...E._accessSources}},x)){let x="".concat(s,"_mm"),D="".concat(i).concat(s[0].toUpperCase()).concat(s.slice(1)),F=[{path:"".concat(i,".").concat(x),value:E[x]},{path:"".concat(i,".").concat(s),value:l(E[s],null!=(f=E.unit)?f:t)},{path:"".concat(i,"_").concat(x),value:e["".concat(i,"_").concat(x)]},{path:D,value:l(e[D],t)},..."cab"===i?[{path:x,value:e[x]},{path:s,value:l(e[s],t)}]:[]],C=r(F),O=null==(c=e.inputValidation)||null==(m=c.fields)?void 0:m["".concat(i,".").concat(x)];["invalid","conflicting"].includes(null==O?void 0:O.status)&&(C=O);let R=null!=(M=null!=(I=null!=(T=null!=(y=null!=(b=null!=(v=null!=(w=null==(d=E._accessSources)?void 0:d[s])?w:E.dimensionSource)?v:E.source)?b:null==(h=e._accessSources)?void 0:h["".concat(i,"_").concat(s)])?y:"cab"===i?null==(u=e._accessSources)?void 0:u[s]:void 0)?T:e.dimensionSource)?I:e.source)?M:"provided_source_unknown",A=null!=(k=null!=(S=E["_".concat(s,"Defaulted")])?S:e["_".concat(i,"_").concat(s,"Defaulted")])?k:"cab"===i&&e["_".concat(s,"Defaulted")];"resolved"===C.status&&(A||(E._defaulted||e._defaulted)&&!(null==(_=E._accessSources)?void 0:_[s])&&!(null==(g=e._accessSources)?void 0:g["".concat(i,"_").concat(s)])||/assumed|default|standard|estimat/.test(R))&&(C.status="assumed"),a["".concat(i,".").concat(x)]={...C,source:R},n[i][x]=null!=(N=C.value)?N:null==(p=F.find(e=>o(e.value)))?void 0:p.value,n[i]._accessSources[s]="assumed"===C.status?"assumed":R}}return n.inputValidation={version:"elevator-input/1",fields:a,complete:Object.values(a).every(e=>"resolved"===e.status)},n}function m(e){if(!e)return null;let t={...e};for(let[n,i]of[["length","width_mm"],["width","depth_mm"],["height","height_mm"]]
1){let a=r([{path:i,value:e[i]},{path:n,value:e[n]}]);t[n]="resolved"===a.status?a.value:void 0,["invalid","conflicting"].includes(a.status)&&(t.elevatorItemIssues={...t.elevatorItemIssues,[n]:a})}return t}},81143:(e,t,n)=>{n.d(t,{AO:()=>a,Lk:()=>r,Ss:()=>l,jq:()=>o});var i=n(87062);function a(e){return"no_fit"===(0,i.fF)(e)}function o(e){return"string"==typeof e&&!!i.ct.has(e)&&!a(e)}function r(e,t){return!(!o(e)||"number"==typeof t&&Number.isFinite(t)&&t<0)}let l="We could not put this result in plain language. The measurements and the calculation below are complete — read them directly."},81196:(e,t,n)=>{n.d(t,{JT:()=>h,dh:()=>u,pJ:()=>w,qG:()=>b,x:()=>f});var i=n(73699);function a(){let e=(0,i._)(["(?:mm|cm|m|in|ins|inch|inches|\"|''|ft|foot|feet|'|’|”)"]);return a=function(){return e},e}function o(){let e=(0,i._)(["(d+(?:.d+)?)s*","\b"],["(\\d+(?:\\.\\d+)?)\\s*","\\b"]);return o=function(){return e},e}let r=Object.freeze({"small box":{width:16,depth:12,height:12},"medium box":{width:18,depth:18,height:16},"large box":{width:18,depth:18,height:24},"wardrobe box":{width:24,depth:21,height:48}}),l=["small","medium","large","extra large","xl","x-large"],s=/\b(?:misc|miscellaneous|assorted|random|sundry|odds\s+and\s+ends|bits\s+and\s+pieces|stuff|things?|items?|knick\s*knacks?)\b/i,m=/\b(?:flat[-\s]?pack(?:ed|s)?|knock(?:ed)?[-\s]?down|disassembled|taken\s+apart|still\s+(?:in|boxed)|unassembled|in\s+(?:the\s+)?(?:original\s+)?(?:ikea\s+)?box(?:es)?|boxed\s+up)\b/i;function c(e){return String(null!=e?e:"").toLowerCase().replace(/\s+/g," ").trim()}function d(e){let t=c(e);return t.endsWith("ies")&&t.length>4?"".concat(t.slice(0,-3),"y"):t.endsWith("es")&&/(?:sh|ch|ss|x|z)es$/.test(t)?t.slice(0,-2):t.endsWith("s")&&!t.endsWith("ss")?t.slice(0,-1):t}function h(e){let t=c(e).split(" ").filter(Boolean);return t.length?d(t[t.length-1]):""}function u(e){return"string"==typeof e&&e.includes("/")?e.replace(/\b([a-z][a-z-]*)\s*\/\s*([a-z][a-z-]*)\b/gi,(e,t,n)=>{let i=l.indexOf(c(t)),a=l.indexOf(c(n));return i>=0&&a>=0&&i>=a?t:n}):e}function _(e){return s.test(String(null!=e?e:""))?"small box":null}let g=/\b(?:like|such as|including|e\.?g\.?)\b/i;function p(e){let t=c(e);return t?/\bwardrobe\b/.test(t)&&/\bbox/.test(t)?"wardrobe box":/\bbox|carton\b/.test(t)?/\b(?:large|extra large|xl|x-large|big)\b/.test(t)?"large box":/\bsmall|book\b/.test(t)?"small box":"medium box":_(t):null}function f(e){let{width_mm:t,depth_mm:n,height_mm:i}=e;return Number.isFinite(i)?{width_mm:t,depth_mm:n,height_mm:Math.max(101.6,Math.round(.35*i))}:{width_mm:t,depth_mm:n,height_mm:i}}function w(e,t){try{let n=String(null!=t?t:"");if(!n)return!0;let i=[null==e?void 0:e.width_mm,null==e?void 0:e.depth_mm,null==e?void 0:e.height_mm].filter(e=>Number.isFinite(e)&&e>0);if(0===i.length)return!0;let r=new Set,l=new Set,s=String.raw(a());for(let e of n.matchAll(RegExp(String.raw(o(),s),"gi")))r.add(Math.round(parseFloat(e[1])));for(let e of n.matchAll(/\d+(?:\.\d+)?/g))l.add(Math.round(parseFloat(e[0])));for(let e of i)for(let t of[e,e/10,e/25.4,e/304.8]){let e=Math.round(t);if(!(e<=0)&&(r.has(e)||r.has(e+1)||r.has(e-1)||e>=12&&l.has(e)))return!0}return!1}catch(e){return!0}}function v(e,t,n,i,a){let o=r[n];return{name:n,qty:t,width_mm:Math.round(25.4*o.width),depth_mm:Math.round(25.4*o.depth),height_mm:Math.round(25.4*o.height),source:"assumed",_assumed:!0,assumption:{rule:i,detail:a}}}function b(){let{items:e=[],quantityItems:t=[],droppedFurniture:n=[],message:i=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[],o=[];try{var l;let s=function(e){let t=String(null!=e?e:""),n=m.exec(t);return n?{packed:!0,cue:n[0].trim()}:null}(i),u=new Set((Array.isArray(e)?e:[]).filter(Boolean).map(e=>{var t;return t=e.name,p(t)||h(t)})),f=new Set,w=e=>{let t=c(e);if(t)for(let e of(f.add(h(t)),t.split(" ").filter(Boolean)))f.add(d(e))};for(let t of(Array.isArray(e)?e:[]).filter(Boolean))w(t.name);let b=(Array.isArray(t)?t:[]).filter(e=>(null==e?void 0:e.name)&&Number.isFinite(e.qty)&&e.qty>=1).map(e=>({...e})),y=new Map,T=new Set;for(let e of b){if(!_(e.name))continue;
1let t=function(e,t){let n=c(t).split(" ").filter(Boolean)[0];if(!n)return"";for(let t of String(null!=e?e:"").split(/\r?\n/)){let e=c(t);if(!e.includes(n))continue;let i=g.exec(e);if(i)return e.slice(i.index+i[0].length)}return""}(i,e.name);if(t)for(let n of b){if(n===e||T.has(n)||p(n.name))continue;let i=h(n.name);if(!i||i.length<3||!new RegExp("\\b".concat(String(null!=i?i:"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?:e?s)?\\b")).test(t))continue;let a=Math.min(n.qty,e.qty);a<1||(e.qty-=a,T.add(n),y.set(e.name,[...y.get(e.name)||[],c(n.name)]))}}for(let e of b){if(!(null==e?void 0:e.name)||!Number.isFinite(e.qty)||e.qty<1)continue;let t=(l=e.name,p(l)||h(l));if(!t||u.has(t))continue;u.add(t),w(e.name);let n=p(e.name);if(n&&_(e.name)){let t=y.get(e.name)||[],i=t.length?" You named ".concat(function(e){let t=(e||[]).filter(Boolean).map(e=>"the ".concat(e));return t.length<=1?t[0]||"":"".concat(t.slice(0,-1).join(", ")," and ").concat(t[t.length-1])}(t)," among them, so ").concat(t.length>1?"those are":"that one is"," sized properly on ").concat(t.length>1?"their own rows":"its own row"," rather than counted twice."):"";a.push(v(e.name,e.qty,n,"R5_bulk_group_proxy","Counting the ".concat(e.qty," miscellaneous items as ").concat(e.qty," ").concat(n,"es (≈").concat(r[n].width,"\xd7").concat(r[n].depth,"\xd7").concat(r[n].height,"″ each) — that is what they pack into. Tell me any large one and I'll size it properly.").concat(i)))}else n?a.push(v(e.name,e.qty,n,"R3_standard_carton","Using a standard ".concat(n," (≈").concat(r[n].width,"\xd7").concat(r[n].depth,"\xd7").concat(r[n].height,"″) for the ").concat(e.qty," you listed."))):a.push({name:c(e.name),qty:e.qty,source:"quantity_parser",assumption:{rule:"R1_one_vocabulary",detail:"Counted ".concat(e.qty," \xd7 ").concat(c(e.name)," from your list.")}})}for(let e of Array.isArray(n)?n:[]){let t=h(e);!t||u.has(t)||f.has(t)||(u.add(t),f.add(t),a.push({name:t,qty:1,source:"recovered_noun",_packedForm:!!s,assumption:{rule:"R7_recovered_dropped_noun",detail
1:s?"Included your ".concat(t,' at a standard size, flat-packed (you said "').concat(s.cue,'").'):"Included your ".concat(t," at a standard size — it was in your list but had no dimensions.")}}))}for(let e of a)e.assumption&&o.push({kind:e.assumption.rule,detail:e.assumption.detail});return s&&a.some(e=>e._packedForm)&&o.push({kind:"R6_packed_form",detail:"Treating the flat-packed items as ~".concat(Math.round(35),"% of their assembled height (footprint unchanged, which errs toward a bigger load).")}),{rows:a,assumptions:o,packedForm:s}}catch(e){return{rows:[],assumptions:[],packedForm:null}}}},82062:(e,t,n)=>{n.d(t,{$u:()=>a,Ej:()=>s,eC:()=>r}),Object.freeze(["MINV_GATE_TYPOGRAPHIC_ONLY_REJECTION","MINV_GATE_SUBJECT_SIGNAL_ONLY_REJECTION","MINV_GATE_ADMITTED","MINV_COVERAGE_UNANSWERED_NAMED_SPACE","MINV_COVERAGE_DECLARED_MISS_MULTI_ITEM","MINV_COVERAGE_UNEVALUATED_CONSTRAINT","MINV_COVERAGE_ORIGIN_VOLUME_UNDERCOUNT","MINV_COVERAGE_VERDICT_WITHHELD","MINV_COVERAGE_ASSESSED_CLEAN","MINV_COVERAGE_GUARD_UNAVAILABLE","MINV_EXTRACTION_FURNITURE_NOUN_UNCAPTURED","MINV_EXTRACTION_SPACE_NOUN_UNCAPTURED","MINV_EXTRACTION_NUMERIC_UNCAPTURED","MINV_INVENTORY_ASSUMPTION_APPLIED","MINV_INVENTORY_SET_UNDERSPECIFIED","MINV_INVENTORY_QUANTITY_UNDERSPECIFIED","MINV_INVENTORY_DIMENSIONS_UNDERSPECIFIED","MINV_INVENTORY_DIMENSIONS_ASSUMED","MINV_MOVING_CLASS_RESOLVED","MINV_PHANTOM_SPACE_DETECTED","MINV_ITEM_IDENTITY_DIVERGED","MINV_ITEM_IDENTITY_RECONCILED","MINV_EXPLAIN_VALIDATOR_REJECTED","MINV_EXPLAIN_ACCEPTED","MINV_OBSERVATION_UNAVAILABLE","MINV_APPAREL_PROFILE_RESOLVED","MINV_APPAREL_PROFILE_UNAVAILABLE","MINV_APPAREL_SIZE_SYSTEM_AMBIGUOUS","MINV_APPAREL_TYPE_DECISIVE","MINV_APPAREL_FORM_DECISIVE","MINV_APPAREL_BULK_DECISIVE","MINV_APPAREL_ASSUMPTION_ROBUST","MINV_APPAREL_RESULT_NON_ROBUST","MINV_APPAREL_CATALOG_VERSION_MISMATCH","MINV_APPAREL_COMPUTE_BUDGET_EXHAUSTED","MINV_APPAREL_PARENT_OFF","MINV_APPAREL_ROBUST_FITS","MINV_APPAREL_QUALIFIED_TIGHT","MINV_APPAREL_ROBUST_DOESNT_FIT","MINV_APPAREL_MODELED_CONSERVATIVE_DOESNT_FIT","MINV_APPAREL_RESULT_INCOMPLETE"]);let i=Object.freeze({furniture_noun_uncaptured:"MINV_EXTRACTION_FURNITURE_NOUN_UNCAPTURED",space_noun_uncaptured:"MINV_EXTRACTION_SPACE_NOUN_UNCAPTURED",numeric_uncaptured:"MINV_EXTRACTION_NUMERIC_UNCAPTURED",phantom_space_detected:"MINV_PHANTOM_SPACE_DETECTED",unanswered_named_space:"MINV_COVERAGE_UNANSWERED_NAMED_SPACE",declared_coverage_miss_multi_item:"MINV_COVERAGE_DECLARED_MISS_MULTI_ITEM",unevaluated_constraint_claimed:"MINV_COVERAGE_UNEVALUATED_CONSTRAINT",origin_volume_undercount:"MINV_COVERAGE_ORIGIN_VOLUME_UNDERCOUNT",typographic_only_rejection:"MINV_GATE_TYPOGRAPHIC_ONLY_REJECTION"});function a(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let a of e){let e=function(e){var t;return"string"!=typeof e?null:null!=(t=i[e])?t:null}(a);e&&!n.has(e)&&(n.add(e),t.push(e))}return t}Object.freeze(Object.keys(i)),Object.freeze(["contradictory_margin","contradictory_limiting_axis","fabricated_dimension","mixed_unit_dimensions","uncomputed_item_constraint","volumetric_as_linear","unverified_entity"]);let o=new Set(Object.freeze(["typographic_gate","subject_signal_gate","coverage_guard","moving_class_dimensions","inventory_assumptions","phantom_space_veto","item_identity_reconcile","inventory_llm_explain"]));function r(e){return"string"==typeof e&&o.has(e)}let l=new Set(Object.freeze(["admission","parse","route","coverage_guard","explain"]));function s(e){return"string"==typeof e&&l.has(e)}},82273:(e,t,n)=>{n.d(t,{q3:()=>D});var i=n(66538),a=n(64295),o=n(11189),r=n(41154),l=n(77632),s=n(96703),m=n(98524),c=n(58950),d=n(45263),h=n(33403),u=n(90453),_=n(98478),g=n(27236),p=n(20514),f=n(74737);n(89175);let w=(0,n(41444).h)("hybrid-pipeline");function v(e){if(!e)return{};let t={};return e.proofSteps&&(t.proofSteps=e.proofSteps),e.tightestPoint&&(t.tightestPoint=e.tightestPoint),e.spaceDims_mm&&(t.spaceDims_mm=e.spaceDims_mm),e.itemDims_mm&&(t.itemDims_mm=e.itemDims_mm),e.itemDimSource&&(t.itemDimSource=e.itemDimSource),e.spaceDimSource&&(t.spaceDimSource=e.spaceDimSource),null!=e.tolerance_mm&&(t.tolerance_mm=e.tolerance_mm),e.orientationRationale&&(t.orientationRationale=e.orientationRationale),e.marginRange&&(t.marginRange=e.marginRange),null!=e.pFit&&(t.pFit=e.pFit),t}function b(e){return Array.isArray(e)&&0!==e.length?e.reduce((e,t)=>
1{let n="number"==typeof(null==e?void 0:e.margin_mm)?e.margin_mm:1/0;return("number"==typeof(null==t?void 0:t.margin_mm)?t.margin_mm:1/0)<n?t:e},e[0]):null}let y={doorway:s.wV,opening:s.wV,hallway:m.C3,stairs:c.Y,turn:d.PU,elevator:h.YM};Object.keys(y);let T=new Set(["stairs","hallway","doorway","opening","entryway"]);function I(e){return{length:e.width_mm||e.length_mm||0,width:e.depth_mm||e.width_mm||0,height:e.height_mm||0,name:e.name,furnitureType:e.furnitureType||e.name}}function M(e){return{length:e.width_mm||e.length_mm||0,width:e.depth_mm||e.width_mm||0,height:e.height_mm||0,type:e.type}}function S(e){if(!e.length)return null;let t=null;for(let i of e){var n;if("UNKNOWN"===i.verdict||-999===i.margin_mm)continue;let e=null!=(n=i.margin_mm)?n:1/0;(null===t||e<t.margin_mm)&&(t={space:i._spaceName||i._spaceType||"unknown",spaceType:i._spaceType||null,margin_mm:e,verdict:i.verdict})}return t}function k(e){return{verdict:"CLARIFY",confidence:"LOW",method:"hybrid_pipeline",queryType:"hybrid",blocker:null,blockerDetail:e,pathResults:[],perItemPathResults:[],containerResult:null,unconstrainedCount:null,assumptions:[e],margin_mm:0}}function N(e,t,n,i,a){var r;let l=e.filter(e=>e.unknown_reason===g.r.STAIR_CARRY_UNPROVEN),s=e=>"access-outcome/1"===e.access_outcome_version&&!0!==e.failed&&!0!==e._cornerWidthAssumed&&!!e.unknown_reason&&!o.Gt.includes(e.unknown_reason)&&"string"==typeof e.message&&""!==e.message.trim(),m=e.filter(e=>e.unknown_reason!==g.r.STAIR_CARRY_UNPROVEN),c=m.filter(e=>!s(e)),d=m.filter(s),h=[...new Set(m.flatMap(e=>e.needs_user_input||[]))],u=[...new Set(c.map(e=>e._spaceName||e._spaceType).filter(Boolean))],_=e.some(e=>/^missing_/.test(e.unknown_reason||"")),f=[c.length?"I need the size of your ".concat(function(e){var t;let n=e.filter(Boolean);return n.length<=1?null!=(t=n[0])?t:"":"".concat(n.slice(0,-1).join(", ")," and ").concat(n[n.length-1])}(u)||"path"," before I can confirm this."):null,...new Set(l.map(e=>e.message||p.wt)),...new Set(d.map(e=>e.message.trim()))].filter(Boolean).join(" "),w=S(t);return{verdict:"UNKNOWN",unknown_reason:(null==(r=(c.length?c:e).find(e=>e.unknown_reason))?void 0:r.unknown_reason)||g.r.MISSING_SPACE_DIMS,failed:e.some(e=>!0===e.failed),margin_mm:null,confidence:"LOW",...e.some(e=>"turn"===e._spaceType)?{confidenceReason:"CORNER_UNVERIFIED",cornerUnverified:!0}:{},method:"hybrid_pipeline",queryType:(null==a?void 0:a.intent)==="capacity"?"capacity":"hybrid",blocker:"path",blockerDetail:f,message:f,pathResults:t,perItemPathResults:n,tightestPathPoint:w,containerResult:null,unconstrainedCount:null,classification:a,pathOnly:!0,...h.length?{needs_user_input:h}:{},_pathChainDiagnostic:x(i,[_?"cause: missing dimensions":"cause: unverified geometry"]),assumptions:[f,...e.some(e=>"turn"===e._spaceType)?["We couldn't check the turn at the corner or landing."]:[]]}}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return["Path-only chain: ".concat(e.length," space(s) — ").concat(e.map(e=>e.type).join(" → ")),...t.filter(Boolean)]}let E="send the landing/corner width and depth (and the turn angle if not 90\xb0)";function D(e){let t=function(e){var t,n,i,s,m;let c,{items:d,pathSpaces:h,containerSpace:p,classification:D,config:F={},configBySpaceType:C={}}=e;if(!(null==d?void 0:d.length))return k("No items provided");if(!(null==h?void 0:h.length))return k("No path constraints provided");let O=!p,R=(0,a.D_)(h),A=O?function(e){if(!Array.isArray(e)||0===e.length)return e;let t=e=>!!e.width_mm&&!e._widthDefaulted&&!e._defaulted&&"default"!==e.dimensionSource;return e.map((n,i)=>{var a,o,r;if("turn"!==n.type||n.width_mm)return n;let l=(n=>{for(let i=n-1;i>=0;i--)if(T.has(e[i].type)&&t(e[i]))return{width_mm:e[i].width_mm,from:e[i].type,defaulted:!1};for(let i=0;i<e.length;i++)if(i!==n&&T.has(e[i].type)&&t(e[i]))return{width_mm:e[i].width_mm,from:e[i].type,defaulted:!1};let i="stairs",a=null;for(let t=n-1;t>=0;t--)if(T.has(e[t].type)){i=e[t].type,e[t].width_mm&&(a=e[t].width_mm);break}return{width_mm:null!=a?a:"hallway"===i?f.aA.hallway.width_mm:"doorway"===i||"opening"===i?f.aA.door.width_mm:f.aA.stairs.width_mm,from:"".concat(i,"_default"),defaulted:!0}})(i);return{...n,width_mm:l.width_mm,width_after_mm:null!=(a=n.width_after_mm)?a:l.width_mm,landing_w_mm:null!=(o=n.landing_w_mm)?o:l.width_mm,landing_d_mm:null!=(r=n.landing_d_mm)?r:f.JV,_cornerWidthAssumed:!0,_cornerWidthFrom:l.from,_cornerWidthDefaulted:l.defaulted}})}(R):R,L=d.map(e=>{let t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=[];for(let s of t){let t,m=y[s.type];if(!m){w.error({msg:"Unknown path solver type",type:s.type}),a.push({verdict:"UNKNOWN",margin_mm:null,confidence:"LOW",method:"path_solver_dispatch",reason:"unknown_path_space_type:".concat(s.type),checked_orientations:[],_unhandledType:!0,_spaceType:s.type,_spaceName:s.name||s.type,_sourceItem:e});continue}let c=function(e){switch(e.type){case"doorway":case"opening":return(0,r.O8)(e);case"hallway":return{width_mm:e.width_mm,height_mm:e.height_mm,length_mm:e.length_mm||e.depth_mm};case"stairs":return(0,r.Bz)(e);case"turn":return{...e,width_mm:e.width_mm,width_after_mm:e.width_after_mm,height_mm:e.height_mm,turn_angle:e.turn_angle,inside_corner_mm:e.inside_corner_mm,inner_radius_mm:e.inner_radius_mm||0,landing_w_mm:e.landing_w_mm,landing_d_mm:e.landing_d_mm};case"elevator":return(0,l.G5)(e);default:return{...e}}}(s),d=(0,r.w0)(s,{...n,...i[s.type]}),h="elevator"===s.type?(0,l.Bs)(e):e;try{t=m(h,c,d)}catch(e){t=(0,o.Sp)({failed:!0,method:"path_solver_dispatch"},g.r.OTHER,"A required path check failed; passage has not been established.")}a.push({...t,_spaceType:s.type,_spaceName:s.name||s.type,_sourceItem:e,...s._doorThenTurn&&{_doorThenTurn:s._doorThenTurn},...s._cornerWidthAssumed&&{_cornerWidthAssumed:!0,_cornerWidthDefaulted:!!s._cornerWidthDefaulted,_cornerWidthFrom:s._cornerWidthFrom}})}return a}(e,A,F,C),n=function(e){if(!e.length)return{footprints:[],blocked:!1,unconstrained:!0};let t=e.map(e=>{let t=e.checked_orientations||[],n=e._sourceItem,i=t.filter(e=>!0===e.feasible),a=function(e){let t=[];for(let n of e)t.some(e=>25.4>Math.abs(e.width_mm-n.width_mm)&&25.4>Math.abs(e.depth_mm-n.depth_mm))||t.push(n);return t}(i.map(e=>{let t=function(e,t){let n=function(e,t){if(!e)return null;let n=e.dimensions_mm||e.dims||e.entry_dimensions_mm;if(n){var i,a,o,r,l,s;let e=null!=(o=null!=(a=null!=(i=n.across_hallway)?i:n.across_door)?a:n.across_mm)?o:n.across,t=null!=(s=null!=(l=null!=(r=n.along_hallway)?r:n.along_depth)?l:n.along_mm)?s:n.along;if(null!=e&&null!=t)return{across_mm:e,along_mm:t}}if(t&&e.face){let n=t.width_mm||0,i=t.depth_mm||0,a=t.height_mm||0;switch(e.face){case"front_back":return{across_mm:n,along_mm:i};
1case"left_right":return{across_mm:i,along_mm:n};case"top_bottom":return{across_mm:n,along_mm:a}}}return null}(e,t);return n&&n.across_mm>0&&n.along_mm>0?{width_mm:n.across_mm,depth_mm:n.along_mm}:null}(e,n);return t?{width_mm:t.width_mm,depth_mm:t.depth_mm,across_mm:t.width_mm,along_mm:t.depth_mm,label:e.orientation||e.face||"feasible",face:e.face,margin_mm:e.margin_mm,method:e.method}:null}).filter(Boolean));return{blocks:t.length>0&&0===i.length,footprints:a}});if(t.some(e=>e.blocks))return{footprints:[],blocked:!0,unconstrained:!1};let n=t.filter(e=>e.footprints.length>0);if(0===n.length)return{footprints:[],blocked:!1,unconstrained:!0};let[i,...a]=n,o=i.footprints.filter(e=>a.every(t=>t.footprints.some(t=>((e,t)=>{let[n,i]=[e.width_mm,e.depth_mm].sort((e,t)=>t-e),[a,o]=[t.width_mm,t.depth_mm].sort((e,t)=>t-e);return 25.4>Math.abs(n-a)&&25.4>Math.abs(i-o)})(e,t))));return{footprints:o,blocked:0===o.length,unconstrained:!1}}(t);return{item:e,pathResults:t,feasibleOrientations:n.footprints,_orientationConstraint:n}}),P=L.flatMap(e=>e.pathResults).filter(e=>(null==e?void 0:e._unhandledType)===!0);if(P.length>0&&!L.some(e=>e.pathResults.some(e=>"DOESNT_FIT"===e.verdict&&e.obstruction_proven))){let e=[...new Set(P.map(e=>e._spaceType))];return w.error({msg:"Hybrid pipeline: unrecognized path space type(s) — returning UNKNOWN instead of phantom FITS",types:e}),function(e,t,n){let i=e.join(", "),a="Couldn't verify the fit: unrecognized path space type(s) — ".concat(i,".");return{verdict:"UNKNOWN",unknown_reason:g.r.UNSUPPORTED_QUERY_TYPE,margin_mm:null,confidence:"LOW",method:"hybrid_pipeline",queryType:(null==n?void 0:n.intent)==="capacity"?"capacity":"hybrid",blocker:"path",blockerDetail:a,pathResults:t.flatMap(e=>e.pathResults),perItemPathResults:t,containerResult:null,unconstrainedCount:null,classification:n,assumptions:[a]}}(e,L,D)}let U=L.flatMap(e=>e.pathResults),H=U.filter(e=>"UNKNOWN"===e.verdict),W=U.filter(e=>"DOESNT_FIT"===e.verdict);if(H.length>0&&0===W.length)return N(H,U,L,h,D);if(O){let e=L.flatMap(e=>e.pathResults),i=e.filter(e=>"DOESNT_FIT"===e.verdict),a=i.filter(e=>"turn"===e._spaceType&&e._cornerWidthAssumed),o=i.filter(e=>!("turn"===e._spaceType&&e._cornerWidthAssumed));if(a.length>0&&0===o.length)return N(a,e,L,h,D);let r=e.filter(e=>"DOESNT_FIT"===e.verdict),l=S(e);if(r.length>0){let t=r.filter(e=>!("turn"===e._spaceType&&e._cornerWidthAssumed)),n=b(t.length>0?t:r),i=S(e.filter(e=>!("turn"===e._spaceType&&e._cornerWidthAssumed)))||l,a=r.filter(e=>"turn"===e._spaceType&&e._cornerWidthAssumed).length>0?['Corner evaluated on an assumed standard 36" landing — a larger landing may clear it; '.concat(E," to confirm.")]:[],o=r.map(e=>e.margin_mm).filter(e=>"number"==typeof e),s=0===o.length,m=h.length>0&&h.every(e=>(null==e?void 0:e._widthDefaulted)===!0||(null==e?void 0:e._lengthDefaulted)===!0||(null==e?void 0:e._depthDefaulted)===!0),c=s&&m,d=c?"We couldn't compute exact clearances because ".concat(h.map(e=>e.type).join(" and ")," dimensions weren't provided. Share the actual ").concat(h.map(e=>"doorway"===e.type?"door width":"".concat(e.type," width")).join(" and ")," for a precise answer."):null;return{verdict:"DOESNT_FIT",margin_mm:o.length>0?Math.min(...o):null,margin_unknown_reason:o.length>0?null:"MARGIN_MISSING_REQUIRED_INPUT",confidence:c?"LOW":"HIGH",method:"hybrid_pipeline",queryType:"hybrid",geometryClass:"passage",blocker:"path",blockerDetail:i,pathResults:e,perItemPathResults:L,tightestPathPoint:i,containerResult:null,unconstrainedCount:null,classification:D,pathOnly:!0,...d&&{recommendation:d},...v(n),_pathChainDiagnostic:x(h,["".concat(r.length," step(s) block the item: ").concat(r.map(e=>e._spaceName||e._spaceType).join(", ")),i?"Tightest path: ".concat(i.space," (").concat(i.margin_mm,"mm)"):null]),assumptions:[...c?["Verdict based on default dimensions — measure your actual path for confidence"]:[],...a]}}let s=Math.min(...e.map(e=>"number"==typeof e.margin_mm?e.margin_mm:1/0).filter(Number.isFinite)),m=s<=10?"FITS_VERY_TIGHT":"FITS",c=b(e),d=e.filter(e=>"turn"===e._spaceType&&e._cornerWidthAssumed),u=d.length>0,_=u?[function(e){let t="number"==typeof e?Math.round(e/25.4):null;return null!==t?'Corner evaluated on an assumed standard 36" landing (clearance ~'.concat(t,'") — ').concat(E," to confirm the pivot."):'
1Corner evaluated on an assumed standard 36" landing — '.concat(E," to confirm the pivot.")}(null!=(n=d[0].margin_mm)?n:s)]:[];return{verdict:m,margin_mm:Number.isFinite(s)?Math.round(s):0,confidence:u?"LOW":"MEDIUM",...u&&{confidenceReason:"ASSUMED_CORNER_WIDTH",recommendation:"To firm up the corner check, ".concat(E,".")},method:"hybrid_pipeline",queryType:"hybrid",geometryClass:"passage",blocker:null,blockerDetail:null,pathResults:e,perItemPathResults:L,pathFeasibleOrientations:(null==(t=L[0])?void 0:t.feasibleOrientations)||[],tightestPathPoint:l,containerResult:null,unconstrainedCount:null,classification:D,pathOnly:!0,...v(c),_pathChainDiagnostic:x(h,[l?"Tightest path: ".concat(l.space," (").concat(l.margin_mm,"mm)"):null]),assumptions:[..._]}}let G=L.filter(e=>e._orientationConstraint.blocked);if(G.length>0){let e=L.flatMap(e=>e.pathResults),t=b(e.filter(e=>"DOESNT_FIT"===e.verdict))||b(e);return{verdict:"DOESNT_FIT",confidence:"HIGH",method:"hybrid_pipeline",queryType:"capacity"===D.intent?"capacity":"hybrid",blocker:"path",blockerDetail:S(e),pathResults:e,perItemPathResults:L,containerResult:null,unconstrainedCount:null,...v(t),assumptions:["".concat(G.length," item(s) cannot pass through path constraints")]}}let q=d[0],j=L[0]._orientationConstraint,z=j.footprints,V=j.unconstrained,B=(e,t)=>25.4>Math.abs((e||0)-(t||0)),Y=!V&&!z.some(e=>B(e.width_mm,q.width_mm)&&B(e.depth_mm,q.depth_mm)||B(e.width_mm,q.depth_mm)&&B(e.depth_mm,q.width_mm)),K=!V&&!Y,$=K?z.map(e=>({w:e.width_mm||e.across_mm||0,d:e.depth_mm||e.along_mm||0,label:e.label||"path-feasible"})):null,X=K?z.map(e=>({l:(e.width_mm||e.across_mm||0)/25.4,w:(e.depth_mm||e.along_mm||0)/25.4,label:e.label||"path-feasible"})):null,Q=null;if("capacity"===D.intent){let e={name:(s=q).name,length_mm:s.width_mm||s.length_mm,width_mm:s.depth_mm||s.width_mm,height_mm:s.height_mm},t={name:(m=p).name||m.type,type:m.type,length_mm:m.width_mm||m.length_mm,width_mm:m.depth_mm||m.width_mm,height_mm:m.height_mm};c=(0,_.solveCapacity)(e,t,{classification:{...D,constraint:"container"},allowedOrientations:X}),Q=(0,_.solveCapacity)(e,t,{classification:{...D,constraint:"container"}}).recommendedCount}else if(d.length>1){let e=d.map(e=>I(e)),t=M(p);c=(0,u.Ve)(e,t,{allowedOrientations:$})}else{let e=I(q),t=M(p);c=(0,u.Cp)(e,t,{allowedOrientations:$})}let J="DOESNT_FIT"!==c.verdict,Z=J?null:"container",ee=J?c.verdict:"DOESNT_FIT",et=L.flatMap(e=>e.pathResults),en=S(et),ei="container"===Z||(null==c?void 0:c.proofSteps)?c:b(et);return{verdict:ee,margin_mm:null!=(i=c.margin_mm)?i:0,confidence:c.confidence||"MEDIUM",method:"hybrid_pipeline",queryType:"capacity"===D.intent?"capacity":"hybrid",blocker:Z,blockerDetail:"container"===Z?"Items can get through but won't all fit":null,pathResults:et,perItemPathResults:L,pathFeasibleOrientations:z,tightestPathPoint:en,containerResult:c,unconstrainedCount:Q,classification:D,...v(ei),assumptions:[...c.assumptions||[],...K?["Path-constrained: only ".concat(z.length," orientation(s) survive")]:[],...Y?["Item cannot be carried in standing upright — it goes through on its side or flat, then is turned upright once inside."]:[],...en?["Tightest path: ".concat(en.space," (").concat(en.margin_mm,"mm)")]:[]]}}(e),n=(0,a.zE)((0,i.fU)(t,t.pathResults));return n.pathOnly=!e.containerSpace,"UNKNOWN"===n.verdict||"CLARIFY"===n.verdict?(0,o.Sp)(n,n.unknown_reason):n}},82559:(e,t,n)=>{n.d(t,{f0:()=>h,gl:()=>u,kx:()=>i.k,lR:()=>_,nP:()=>m,sZ:()=>d,yi:()=>g});var i=n(90836),a=n(58271),o=n(14103),r=n(95704);let l=["web_extraction:unavailable","web_extraction:fail","web_extraction:no_service","llm_estimate:error","llm_estimate:no_client","llm_estimate:invalid_json","llm_estimate:billing_blocked"],s=new Set(["llm_estimate:missing_dims","llm_estimate:out_of_bounds","llm_estimate:ratio_fail"]);function m(e){let{fullDepth:t=!1,skippedSteps:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Array.isArray(e)?e:[];if(i.some(e=>l.some(t=>e.startsWith(t))))return"error_transient";if(!t||n)return null;let a=i.includes("web_extraction:clean_miss"),o=i.some(e=>s.has(e));return a&&o?"unresolvable":null}let c={error_transient:900,unresolvable:604800};function d(){let e=void 0!==r&&r.env.DIMENSION_STATUS_CACHE||"off";return"shadow"===e||"live"===e?e:"off"}async function h(e,t){let{supabase:n}=t;if(!n||!e)return null;try{let t=new Date().toISOString(),i=n.from("dimension_resolution_status").select("status, source, failure_reason").eq("normalized_name",e).gt("expires_at",t).maybeSingle(),a=new Promise(e=>setTimeout(()=>e({data:null,error:"timeout"}),800)),{data:o,error:r}=await Promise.race([i,a]);if(r||!o)return null;return{status:o.status,source:o.source,failure_reason:o.failure_reason}}catch(e){return null}}async function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{supabase:i}=arguments.length>3?arguments[3]:void 0;if((0,o.G)()||!i||!e)return;let a="shallow"===n.resolver?"shallow":"full";if("unresolvable"===t&&"full"!==a)return;let r=c[t];if(r)try{await i.rpc("record_dimension_resolution_status",{p_name:e,p_status:t,p_source:n.source||"cascade",p_reason:(n.failureReason||(Array.isArray(n.pathSegments)?n.pathSegments.join("→"):null)||"").slice(0,200),p_resolver:a,p_ttl_seconds:r})}catch(e){}}async function _(e,t){let{supabase:n}=t;if(!(0,o.G)()&&n&&e)try{await n.from("dimension_resolution_status").delete().eq("normalized_name",e)}catch(e){}}function g(e){let{normalizedName:t,wouldSuppress:n,liveResolved:o,liveSource:r,savedWeb:l,savedLlm:s,latencyMs:m}=e;a.U.warn("[STATUS-CACHE-SHADOW] key=".concat((0,i.k)(t)," ")+"would_suppress=".concat(n||"none"," ")+"live_resolved=".concat(o?"true":"false"," ")+"live_source=".concat(r||"none"," ")+"saved_web=".concat(+!!l," saved_llm=").concat(+!!s," latency_ms=").concat(null!=m?m:0))}},82734:(e,t,n)=>{n.d(t,{NX:()=>g,a6:()=>p,KK:()=>f,Ox:()=>_,G4:()=>v,xT:()=>w});var i=n(58271),a=n(96703),o=n(65927),r=n(33403),l=n(98524),s=n(45263),m=n(58950),c=n(97360),d=n(95704);let h={DOESNT_FIT:0,CLARIFY:.5,UNKNOWN:1,FITS_WONT_CLOSE:1.5,FITS_VERY_TIGHT:1.8,FITS_TIGHT:2,FITS_TILTED:2,FITS:3};function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{family:n=null,resolveDenominator:a=null}=t;return async function(t,o,r){var l,s,m;let u=[...t].map((e,t)=>({item:e,originalIndex:t})).sort((e,t)=>
1{let n=(e.item.length||0)*(e.item.width||0)*(e.item.height||0);return(t.item.length||0)*(t.item.width||0)*(t.item.height||0)-n}),_=[],g="FITS",p=0;for(let{item:t,originalIndex:n}of u){let i=await e(t,o,r);if(_[n]=i,(null!=(l=h[i.verdict])?l:1)<(null!=(s=h[g])?s:3)&&(g=Object.hasOwn(h,i.verdict)?i.verdict:"UNKNOWN",p=n),"DOESNT_FIT"===i.verdict&&!(null==r?void 0:r.exhaustive)&&!(null==r?void 0:r.withPerItemCalcs))break}let f=_[p]||{},w=_.map((e,n)=>({r:e,i:n,item:t[n]})).filter(e=>e.r&&e.item),v=(()=>{let e=function(){let e=String(void 0!==d&&d.env.MULTI_ITEM_COLLECTIVE_WEIGHT||"off").toLowerCase();return"shadow"===e||"live"===e?e:"off"}();if("off"===e)return[];let r=a?a(o):null,l=function(e){let{items:t=[],family:n,denominator:i}=e;if(!i)return{step:null,note:null};let a=null!=i.limit_lb?i.limit_lb:null!=i.limit_kg?2.2046226218*i.limit_kg:null;if(null==a||!(a>0))return{step:null,note:null};let o=t.reduce((e,t)=>e+((null==t?void 0:t.weight_lbs)||0)*((null==t?void 0:t.qty)||1),0);if(!(o>0))return{step:null,note:{kind:"weight_unknown",detail:"Item weights unknown — combined-weight check skipped."}};let r=o<=a;return{step:{id:"weight_inequality",passed:r,..."elevator"===n&&!r?{limiting:!0}:{},values:{total_weight_lb:Math.round(o),limit_lb:Math.round(a),headroom_lb:Math.round(a-o),basis:i.basis}},note:null}}({items:t.map(e=>({name:null==e?void 0:e.name,weight_lbs:function(e){if(!e||"number"!=typeof e.value)return;let t=(e.unit||"lb").toLowerCase();return"kg"===t?2.2046226218*e.value:"g"===t?2.2046226218*e.value/1e3:"oz"===t?e.value/16:e.value}(null==e?void 0:e.weight),qty:(null==e?void 0:e.qty)||1})),family:n,denominator:r});try{var s,m,c,h,u,_,g,p;i.U.log("[COLLECTIVE-WEIGHT-SHADOW]",JSON.stringify({family:n||null,weightKnown:null!=l.step,limit_basis:null!=(_=null==r?void 0:r.basis)?_:null,total_weight_lb:null!=(g=null==(m=l.step)||null==(s=m.values)?void 0:s.total_weight_lb)?g:null,limit_lb:null!=(p=null==(h=l.step)||null==(c=h.values)?void 0:c.limit_lb)?p:null,emitted:"live"===e&&null!=l.step,limiting:!!(null==(u=l.step)?void 0:u.limiting)}))}catch(e){}return"live"===e&&l.step?[l.step]:[]})(),b=(0,c.d)({items:w.map(e=>{let{r:t,item:n}=e;return{name:n.name,dims:t.itemDims_mm||(n.dimensions?{width_mm:n.dimensions.width,height_mm:n.dimensions.height,...null!=n.dimensions.depth?{depth_mm:n.dimensions.depth}:{}}:void 0)}}),mode:"independent",perItemSteps:(e,t)=>{var n,i;return(null==(i=w[t])||null==(n=i.r)?void 0:n.proofSteps)||[]},collective:v}),y=v.find(e=>e&&"weight_inequality"===e.id&&!0===e.limiting)||null,T=g,I=["UNKNOWN","CLARIFY"].includes(g)?null:null!=(m=f.margin_mm)?m:-999,M=f.limiting_constraint,S="Worst case: item ".concat(p+1," — ").concat(g);return y&&(T="DOESNT_FIT",M="weight",I=null,S="Combined weight exceeds the elevator rating — DOESNT_FIT"),{verdict:T,itemResults:_,worstItemIndex:p,...f.accessPathMeasurements?{accessPathMeasurements:f.accessPathMeasurements}:{},...f.accessPathCheck?{accessPathCheck:f.accessPathCheck}:{},...["UNKNOWN","CLARIFY"].includes(T)?{pipeline_complete:!1,unknown_reason:f.unknown_reason||"genuinely_underspecified",margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",needs_user_input:[...new Set(_.flatMap(e=>(null==e?void 0:e.needs_user_input)||[]))]}:{},margin_mm:I,limiting_constraint:M,confidence:f.confidence,checked_orientations:f.checked_orientations||[],explanation:S,...f.proofSteps&&{proofSteps:f.proofSteps},...f.tightestPoint&&{tightestPoint:f.tightestPoint},...f.spaceDims_mm&&{spaceDims_mm:f.spaceDims_mm},...f.spaceDims_raw_mm&&{spaceDims_raw_mm:f.spaceDims_raw_mm},...f.itemDims_mm&&{itemDims_mm:f.itemDims_mm},...f.itemDimSource&&{itemDimSource:f.itemDimSource},...f.spaceDimSource&&{spaceDimSource:f.spaceDimSource},...null!=f.tolerance_mm&&{tolerance_mm:f.tolerance_mm},...f.orientationRationale&&{orientationRationale:f.orientationRationale},...f.marginRange&&{marginRange:f.marginRange},...null!=f.pFit&&{pFit:f.pFit},...b.proofSteps.length?{proofSteps:b.proofSteps,items:b.items,multiItem:b.multiItem}:{}}}}let _=u(a.wV,{family:"opening"}),g=u(o.GV,{family:"container"}),p=u(r.YM,{family:"elevator",resolveDenominator:function(e){let t=((null==e?void 0:e.type)||(null==e?void 0:e.kind)||(null==e?void 0:e.elevatorType)||(null==e?void 0:e.cabClass)||"passenger").toLowerCase(),n=r.wf[t]||r.wf.passenger,i=null==n?void 0:n.rated_capacity_kg;return null!=i&&i>0?{basis:"rated_capacity",limit_kg:i}:null}}),f=u(l.C3,{family:"hallway"}),w=u(s.PU,{family:"turn"}),v=u(m.Y,{family:"stairs"})},84511:(e,t,n)=>{n.d(t,{LP:()=>_,bz:()=>p,fN:()=>w});var i=n(31990),a=n(81196),o=n(95704);let r={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,hundred:100},l=/\b(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty|hu
1ndred)\s+([a-z][a-z\s]*?)(?:\s*\([\d×x\s"'incmft]+\))?(?=[,;.?!\n\r]|\s+and\s+|\s+in(?:to|side)?\s+|\s*$)/gi,s="in|inch|inches|ft|foot|feet|cm|mm|m|(?:centi|milli)?met(?:er|re)s?",m=RegExp("^(?:"+"(?:sq|cu)\\s*(?:".concat(s,")?")+"|sf"+"|(?:square|cubic)\\s+(?:".concat(s,")")+"|".concat(s)+"|litre|litres|liter|liters|gallon|gallons|\"|'|deg|degree|degrees)(?:\\b|$)","i"),c=new Set(["long","high","tall","wide","deep","thick","across","broad","width","height","depth","length"]),d=new Set(["seater","seat","door","drawer","piece","burner","tier","shelf","panel","cushion","person","section","berth","speed","cu","cubic"]),h=new Set(["side","sides","end","ends","edge","edges","face","faces","wall","walls","corner","corners","axis","span"]),u=new Set(["'",'"',"′","″","’","”"]);function _(e){let t=String(e||"").trimStart(),n=t.match(/^(\d+(?:\.\d+)?)/);if(!n)return!1;let i=t.slice(n[1].length,n[1].length+24);return!!/^\s*["'°]/.test(i)||m.test(i.replace(/^\s*/,""))}let g=/\s+(?:(?:will|would|could|should)\b.*|fits?(?:\s+(?:in|into|inside|through|on|under|up|down|out|my|our|the|a|an|it|them|there|here|all|everything)\b.*)?)$/i;function p(e){let t;if(!e)return[];let n=(0,a.dh)(e),s=[];for(l.lastIndex=0;null!==(t=l.exec(n));){var _,p;let e=t[1],a=isNaN(e)?r[e.toLowerCase()]||1:parseInt(e,10),f=()=>{l.lastIndex=t.index+e.length};if(!isNaN(e)){if(/^(?:19|20)\d{2}$/.test(e)||"."===n[t.index-1]&&/\d/.test(n[t.index-2]||"")||(_=t.index,u.has(n[_-1])&&/\d/.test(n[_-2]||"")||function(e,t,n){let i=e.slice(t+n,t+n+24);if(/^\s*["'°]/.test(i))return!0;let a=i.replace(/^\s*/,"");return m.test(a)}(n,t.index,e.length)||"live"===function(){let e=String(void 0!==o&&o.env.PHANTOM_COUNT_SOURCE_GUARD||"").trim().toLowerCase();return"shadow"===e||"live"===e?e:"off"}()&&function(e,t,n,i){let a=Number.parseInt(e.slice(t,t+n),10);if(!Number.isFinite(a)||a<5)return!1;let o=e.slice(Math.max(0,t-24),t),r=String(i||"").trim().toLowerCase();if(/[x×]\s*$/i.test(o)||/by\s*$/i.test(o)||/(?:ft|foot|feet)\s*$/i.test(o)||/\d+(?:\.\d+)?\s+$/.test(o))return!0;if(/^(?:long|wide|high|tall|deep|thick|width|height|depth|length)\b/.test(r)){let e=r.split(/\s+/).at(-1)||"";if(!/s$/i.test(e))return!0}return!!(/[$€£]\s*$/.test(o)||/^dollars?\s+bill\b/.test(r))}(n,t.index,e.length,t[2]))){f();continue}let i=t[2].trim().split(/\s+/)[0]||"";if(m.test(i)){f();continue}}let w=String((p=t[2])||"").replace(g,"").trim()||String(p||"").trim();if((0,i.Iq)(w)||c.has(w.toLowerCase())||h.has(w.toLowerCase())||function(e){let t=String(e||"").trim().toLowerCase().split(/\s+/).filter(Boolean);return t.length>=2&&d.has(t[0])}(w)){f();continue}/(?:sh|ch|x|z|s)es$/i.test(w)?w=w.replace(/es$/,""):!w.endsWith("s")||w.endsWith("ss")||w.endsWith("us")||(w=w.replace(/s$/,"")),a>0&&w.length>1&&s.push({name:w,qty:a})}return s}let f=/\b(?:a\s+bunch\s+of|some|various|misc|miscellaneous|random|assorted|few|several)\b.{0,80}\b(?:boxes?|stuff|items?|things?|misc|kitchen\s+stuff|clothes?|toys?|books?)\b/i;function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!f.test(e))return null;let n=function(){let{bedrooms:e=0,sqft:t=0,occupants:n=0,hasStorageMention:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=3;return e>=2&&(a+=e-1),t>=1500?a+=2:t>=1e3&&(a+=1),n>=3&&(a+=n-2),i&&(a+=1),Math.max(3,Math.min(10,a))}(t);return{name:"medium box (assumed)",qty:n,width_in:18,depth_in:18,height_in:16,_assumed:!0,_assumption_inputs:{...t,qty:n}}}},84683:(e,t,n)=>{n.d(t,{J5:()=>i,yV:()=>a});let i={sofa:{width:84,depth:36,height:34},couch:{width:84,depth:36,height:34},loveseat:{width:60,depth:36,height:34},sectional:{width:108,depth:84,height:34},bed:{width:54,depth:75,height:14},"queen bed":{width:60,depth:80,height:14},"king bed":{width:76,depth:80,height:14},"twin bed":{width:39,depth:75,height:14},mattress:{width:54,depth:75,height:10},desk:{width:48,depth:24,height:30},"study table":{width:48,depth:24,height:30},table:{width:48,depth:30,height:30},"dining table":{width:72,depth:36,height:30},"coffee table":{width:48,depth:24,height:18},nightstand:{width:20,depth:18,height:24},"bedside table":{width:20,depth:18,height:24},dresser:{width:60,depth:18,height:34},wardrobe:{width:48,depth:24,height:72},bookshelf:{width:36,depth:12,height:72},chair:{width:24,depth:24,height:34},"office chair":{width:26,depth:26,height:42},recliner:{width:36,depth:38,height:40},refrigerator:{width:36,depth:30,height:70},fridge:{width:36,depth:30,height:70},washer:{width:27,depth:30,height:36},dryer:{width:27,depth:30,height:36},dishwasher:{width:24,depth:24,height:34},microwave:{width:20,depth:15,height:12},oven:{width:30,depth:26,height:28},tv:{width:50,depth:4,height:30},television:{width:50,depth:4,height:30},monitor:{width:24,depth:8,height:16},lamp:{width:12,depth:12,height:24},"floor lamp":{width:12,depth:12,height:60},fan:{width:18,depth:18,height:48},"air conditioner":{width:24,depth:20,height:16}
1,treadmill:{width:36,depth:72,height:56},piano:{width:58,depth:24,height:40},"upright piano":{width:58,depth:24,height:48},ottoman:{width:30,depth:30,height:18},"storage ottoman":{width:36,depth:36,height:18},bench:{width:48,depth:18,height:18},futon:{width:80,depth:36,height:34},"bar stool":{width:16,depth:16,height:30},crib:{width:28,depth:52,height:36},kayak:{width:28,depth:120,height:14},bicycle:{width:24,depth:68,height:42},"exercise bike":{width:22,depth:48,height:50},"large suitcase":{width:30,depth:20,height:12},suitcase:{width:26,depth:18,height:11},backpack:{width:18,depth:12,height:20},purse:{width:14,depth:6,height:10},"medium bag":{width:24,depth:16,height:12},bag:{width:24,depth:16,height:12},"small box":{width:16,depth:12,height:12},"medium box":{width:18,depth:18,height:16},"large box":{width:18,depth:18,height:24},"small moving box":{width:16,depth:12,height:12},"medium moving box":{width:18,depth:18,height:16},"large moving box":{width:18,depth:18,height:24},"moving box":{width:18,depth:18,height:16},"book box":{width:16,depth:12,height:12}};function a(e){if(!e||"string"!=typeof e)return null;let t=e.toLowerCase().trim();if(!t)return null;let n=null;if(i[t])n=i[t];else for(let[e,a]of Object.entries(i))if(t.includes(e)||e.includes(t)){n=a;break}return n?{dimensions:{width:n.width,depth:n.depth,height:n.height},unit:"in",confidence:.55,source:"estimate_table",variant:null,assumptions:["Estimated from the common-item table as typical ".concat(t," dimensions")]}:null}},84849:(e,t,n)=>{n.d(t,{U:()=>i});let i={span:{STATIC_FIT:1,ROTATION_SUFFICIENT:1.5,MOTION_REQUIRED:3},corner:{TRIVIAL:1.5,ROTATION_NEEDED:2.5,MOTION_SOLVER:3},vehicle:{EASY:1,CAREFUL:2,MOTION_SOLVER:3},detection:{MOTION_SOLVER:.6,MOTION_ADVISORY:.3},margins:{residential:{STATIC_CLEARANCE:100,VEHICLE_CLEARANCE:200},warehouse:{STATIC_CLEARANCE:75,VEHICLE_CLEARANCE:150},industrial:{STATIC_CLEARANCE:50,VEHICLE_CLEARANCE:100},DEFAULT_ENVIRONMENT:"warehouse",TIGHT_THRESHOLD:150,UNKNOWN_THRESHOLD:50}}},89097:(e,t,n)=>{n.d(t,{$f:()=>h,Eh:()=>g,eG:()=>d,gz:()=>_,ht:()=>f,yi:()=>p});var i=n(14103),a=n(58271),o=n(48491),r=n(76683),l=n(31990),s=n(6063),m=n(82559),c=n(95704);function d(e,t,n){if((e=String(null!=e?e:""))===(t=String(null!=t?t:"")))return 0;let i=e.length,a=t.length;if(Math.abs(i-a)>n)return n+1;let o=Array(a+1),r=Array(a+1);for(let e=0;e<=a;e++)o[e]=e;for(let l=1;l<=i;l++){r[0]=l;let i=r[0],s=e.charCodeAt(l-1);for(let e=1;e<=a;e++){let n=+(s!==t.charCodeAt(e-1));r[e]=Math.min(o[e]+1,r[e-1]+1,o[e-1]+n),r[e]<i&&(i=r[e])}if(i>n)return n+1;let m=o;o=r,r=m}return o[a]<=n?o[a]:n+1}function h(e){return e<5?0:e<10?1:2}let u=null;function _(e){let t=String(null!=e?e:"");if(!t)return{verdict:"NOVEL",nearMatch:null,distance:null};let{set:n,byLength:i}=function(){if(u)return u;let e=new Set,t=new Set,n=function(n){let{fuzzy:i=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,s.S)(n||"");a&&(e.add(a),i&&t.add(a))};for(let e of Object.values(o.L))if(null==e?void 0:e.items)for(let[t,i]of Object.entries(e.items))n(null==i?void 0:i.name),n(t.replace(/_/g," "));for(let[e,t]of Object.entries(r.PH))if(n(e),Array.isArray(t))for(let e of t)n(e);for(let e of Object.keys(r.Hg))n(e,{fuzzy:!1});for(let e of l.VN.keys())n(e,{fuzzy:!1});for(let e of l.fM)n(e);let i=new Map;for(let e of t){let t=e.length;i.has(t)||i.set(t,[]),i.get(t).push(e)}return u={set:e,byLength:i}}();if(n.has(t))return{verdict:"KNOWN",nearMatch:t,distance:0};let a=h(t.length);if(0===a)return{verdict:"NOVEL",nearMatch:null,distance:null};let m=t.match(/\d+/g)||[],c=null,_=a+1;for(let e=t.length-a;e<=t.length+a;e++){let n=i.get(e);if(n){for(let e of n){let n=e.match(/\d+/g)||[];if(m.length!==n.length||m.some((e,t)=>e!==n[t]))continue;let i=d(t,e,a);if(i>=1&&i<_&&(_=i,c=e,1===i))break}if(1===_)break}}return c&&_<=a?{verdict:"PROBABLE_TYPO",nearMatch:c,distance:_}:{verdict:"NOVEL",nearMatch:null,distance:null}}function g(){let e=void 0!==c&&c.env.DIMENSION_KEY_VALIDATION||"off";return"shadow"===e||"live"===e?e:"off"}function p(e,t){var n;a.U.warn("[KEY-VALIDATION-SHADOW]",JSON.stringify({verdict:(null==e?void 0:e.verdict)||null,
1nearMatch:(null==e?void 0:e.nearMatch)||null,distance:null!=(n=null==e?void 0:e.distance)?n:null,keyHash:(0,m.kx)(t),len:String(null!=t?t:"").length}))}async function f(e,t,n){if(!(0,i.G)()&&e&&(null==t?void 0:t.verdict)==="PROBABLE_TYPO"&&n)try{await e.rpc("record_dimension_key_typo_candidate",{p_normalized_query:n,p_suggested_canonical:t.nearMatch,p_distance:t.distance})}catch(e){}}},90453:(e,t,n)=>{n.d(t,{Ve:()=>P,Cp:()=>A});var i=n(58271),a=n(91550),o=n(69574),r=n(24936);let l={compact:{label:"Compact Urban",description:"Tight but livable — typical for city apartments",multiplier:.75},standard:{label:"Standard Residential",description:"US/EU standard residential clearances",multiplier:1},comfort:{label:"Comfort-First",description:"Generous clearances for easy movement",multiplier:1.25}},s={bedroom:{label:"Bedroom",defaultCirculation_mm:610,assumedDoorCount:1,defaultComfortProfile:"standard",typicalObstacles:["bed","nightstand"]},living_room:{label:"Living Room",defaultCirculation_mm:762,assumedDoorCount:1,defaultComfortProfile:"standard",typicalObstacles:["sofa","coffee_table","tv_stand"]},kitchen:{label:"Kitchen",defaultCirculation_mm:914,assumedDoorCount:1,defaultComfortProfile:"standard",typicalObstacles:["counter","island","refrigerator"]},dining_room:{label:"Dining Room",defaultCirculation_mm:762,assumedDoorCount:1,defaultComfortProfile:"standard",typicalObstacles:["dining_table","china_cabinet"]},closet:{label:"Closet",defaultCirculation_mm:457,assumedDoorCount:1,defaultComfortProfile:"compact",typicalObstacles:[]},garage:{label:"Garage",defaultCirculation_mm:610,assumedDoorCount:1,defaultComfortProfile:"compact",typicalObstacles:["vehicle"]},patio:{label:"Patio",defaultCirculation_mm:610,assumedDoorCount:0,defaultComfortProfile:"standard",typicalObstacles:[]},bathroom:{label:"Bathroom",defaultCirculation_mm:610,assumedDoorCount:1,defaultComfortProfile:"compact",typicalObstacles:["toilet","vanity","tub"]},office:{label:"Office",defaultCirculation_mm:762,assumedDoorCount:1,defaultComfortProfile:"standard",typicalObstacles:["desk","bookshelf"]}},m=[a,o,r],c={sofa:"couch",sectional:"couch",loveseat:"couch",bed_frame:"bed",mattress:"bed",desk:"office_desk",table:"dining_table",armchair:"accent_chair",fridge:"refrigerator",freezer:"chest_freezer",washer:"washing_machine",stove:"range",oven:"range",exercise_bike:"spin_bike",stationary_bike:"spin_bike",rower:"rowing_machine"},d={bed:{twin:"bed_twin",single:"bed_twin",full:"bed_full",double:"bed_full",queen:"bed_queen",king:"bed_king",california_king:"bed_king",cal_king:"bed_king"},couch:{small:"loveseat",loveseat:"loveseat",large:"sectional_l_shape",sectional:"sectional_l_shape"},office_desk:{small:"desk_writing",writing:"desk_writing",large:"desk_executive",executive:"desk_executive",standing:"desk_standing"},dining_table:{small:"dining_table_4_person",large:"dining_table_6_person",round:"dining_table_round_4"},wardrobe:{small:"wardrobe_single",single:"wardrobe_single",large:"wardrobe_double",double:"wardrobe_double"},refrigerator:{standard:"fridge_standard",french_door:"fridge_standard",side_by_side:"fridge_side_by_side",apartment:"fridge_apartment",small:"fridge_apartment"},washing_machine:{front_load:"washer_front_load",front:"washer_front_load",top_load:"washer_top_load",top:"washer_top_load"},treadmill:{home:"treadmill_home",standard:"treadmill_home",commercial:"treadmill_commercial",gym:"treadmill_commercial"},power_rack:{standard:"power_rack_standard",squat_stand:"squat_stand",open:"squat_stand"}},h={refrigerator:[{origin:"front",radius_mm:Math.round(914.4),arc_degrees:120,direction:"outward",label:"fridge door swing"}],washing_machine:[{origin:"front",radius_mm:Math.round(609.5999999999999),arc_degrees:160,direction:"outward",label:"washer door swing"}],dryer:[{origin:"front",radius_mm:Math.round(609.5999999999999),arc_degrees:160,direction:"outward",label:"dryer door swing"}],range:[{origin:"front",radius_mm:Math.round(508),arc_degrees:90,direction:"downward",label:"oven door drop"}],dishwasher:[{origin:"front",radius_mm:Math.round(609.5999999999999),arc_degrees:90,direction:"downward",label:"dishwasher door drop"}],chest_freezer:[{origin:"top",radius_mm:Math.round(609.5999999999999),arc_degrees:90,direction:"upward",label:"freezer lid"}]},u={treadmill:[{side:"back",depth_mm:Math.round(1219.1999999999998),label:"safety dismount zone"}],power_rack:[{side:"front",depth_mm:Math.round(914.4),label:"barbell loading zone"}],rowing_machine:[{side:"back",depth_mm:Math.round(609.5999999999999),label:"slide travel zone"}],piano:[{side:"front",depth_mm:Math.round(914.4),label:"bench / player seating"}]},_={front_mm:610,left_mm:305,right_mm:305,back_mm:0,placement:["floor","against_wall"],accessSides:["front"],swingZones:null,operationalZones:null};function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=i*n;return{front:Math.max(e.front_mm*n,a),back:t.touchesBackWall?0:Math.max(e.back_mm*n,a),left:t.touchesLeftWall?0:Math.max(e.left_mm*n,a),right:t.touchesRightWall?0:Math.max(e.right_mm*n,a)}}function p(e,t){return t<=0?1/0:e/t}function f(e){var t;let n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=Object.entries(e).filter(e=>{let[,t]=e;return t!==1/0&&isFinite(t)}
1);if(0===o.length)return{verdict:"FITS",tone:"confident",worstRatio:1/0,limitingSide:null,ratios:e};let r=Math.min(...o.map(e=>{let[,t]=e;return t})),l=(null==(t=o.find(e=>{let[,t]=e;return t===r}))?void 0:t[0])||null;return r<=0||r<.5?(n="DOESNT_FIT",i="definitive"):r<.75?(n="FITS_VERY_TIGHT",i="cautious"):r<.995?(n="FITS_TIGHT",i="moderate"):(n="FITS",i="confident"),(null==a?void 0:a.blocksRequiredClearance)?(n="DOESNT_FIT",i="definitive"):(null==a?void 0:a.reducesRatio)&&"DOESNT_FIT"!==n&&("FITS"===n?(n="FITS_TIGHT",i="moderate"):"FITS_TIGHT"===n?(n="FITS_VERY_TIGHT",i="cautious"):"FITS_VERY_TIGHT"===n&&(n="DOESNT_FIT",i="definitive")),{verdict:n,tone:i,worstRatio:r,limitingSide:l,ratios:e}}function w(e,t,n){let i;if(!e||!e.width_mm||e.width_mm<=0||"outward"===e.swingDirection)return null;let a=e.width_mm;switch(e.position||"center"){case"left":i=0;break;case"right":i=t-a;break;default:i=(t-a)/2}return{x:i,y:n-a,w:a,d:a}}function v(e,t,n){let i,a;if(!n)return{conflicts:!1,blocksRequiredClearance:!1,reducesRatio:!1};let{itemFloorW:o,itemFloorD:r,roomFloorW:l,roomFloorD:s,strategy:m}=e;if("floating"===m.id)i=(l-o)/2,a=(s-r)/2;else switch(a=0,m.id){case"wall_left":i=0;break;case"wall_right":i=l-o;break;default:i=(l-o)/2}let c=i-t.left,d=a-t.back,h=o+t.left+t.right,u=r+t.back+t.front,_=Math.max(0,Math.min(c+h,n.x+n.w)-Math.max(c,n.x))*Math.max(0,Math.min(d+u,n.y+n.d)-Math.max(d,n.y));if(_<=0)return{conflicts:!1,blocksRequiredClearance:!1,reducesRatio:!1};let g=t.front>0?o*t.front:0,p=g>0&&_>.5*g;return{conflicts:!0,blocksRequiredClearance:p,reducesRatio:!p}}var b=n(85850),y=n(16979),T=n(95704);let I=e=>Math.max(0,Math.min(1,e)),M=e=>Math.round(1e3*e)/1e3;function S(e){let{coverage:t,walkwayRatio:n,swing:i,access:a,verdict:o,modeledSwing:r,modeledAccess:l}=e,s=Number.isFinite(t)?t:0,m=Number.isFinite(n)?n:1,c=Number.isFinite(i)?i:1,d=Number.isFinite(a)?a:0;return[{key:"coverage",label:"floor coverage",raw:M(s),normalized:M(I(1-s)),tier:s<=1?s>.85?"tight":"good":"poor",modeled:!0},{key:"walkway",label:"walkway",raw:M(m),normalized:M(I(m)),tier:"DOESNT_FIT"===o?"poor":"FITS_TIGHT"===o||"FITS_VERY_TIGHT"===o?"tight":"good",modeled:!0},{key:"swing",label:"door swing",raw:M(c),normalized:M(I(c)),tier:c<=0?"poor":c<1?"tight":"good",modeled:!!r},{key:"access",label:"side access",raw:M(d),normalized:M(I(d)),tier:d>=1?"good":d>=.5?"tight":"poor",modeled:!!l}]}let k={CENTERED:{id:"centered",label:"centered against one wall",meta:{touchesBackWall:!0,touchesLeftWall:!1,touchesRightWall:!1,allSidesAccessible:!1}},AGAINST_WALL_LEFT:{id:"wall_left",label:"in the corner (left wall)",meta:{touchesBackWall:!0,touchesLeftWall:!0,touchesRightWall:!1,allSidesAccessible:!1}},AGAINST_WALL_RIGHT:{id:"wall_right",label:"in the corner (right wall)",meta:{touchesBackWall:!0,touchesLeftWall:!1,touchesRightWall:!0,allSidesAccessible:!1}},FLOATING:{id:"floating",label:"centered in room",meta:{touchesBackWall:!1,touchesLeftWall:!1,touchesRightWall:!1,allSidesAccessible:!0}}};function N(e,t,n,i,a){let o,r,l,s;if("floating"===a.id)o=(n-e)/2,r=(n-e)/2,l=(i-t)/2,s=(i-t)/2;else switch(s=0,l=i-t,a.id){case"centered":default:o=(n-e)/2,r=(n-e)/2;break;case"wall_left":o=0,r=n-e;break;case"wall_right":o=n-e,r=0}let m=[];o>0&&m.push("left"),r>0&&m.push("right"),l>0&&m.push("foot"),s>0&&m.push("head");let c=m.map(e=>"left"===e?o:"right"===e?r:"foot"===e?l:s),d=c.length>0?Math.min(...c):0;return{left:o,right:r,foot:l,head:s,min_walkway_mm:d,accessible:m}}let x={bed:{againstWall:!0,bothSidesAccessible:!0,nightstandsAssumed:!1},dining_table:{centered:!0,allSidesAccessible:!0},office_desk:{againstWall:!0,chairPullback:!0},wardrobe:{againstWall:!0,doorSwingClearance:!0},couch:{againstWall:!0,walkPastClearance:!0},refrigerator:{againstWall:!0,doorSwingClearance:!0},washing_machine:{againstWall:!0,doorSwingClearance:!0},range:{againstWall:!0,doorSwingClearance:!0},treadmill:{againstWall:!1,safetyZoneBehind:!0},power_rack:{againstWall:!1,barbellLoadingZone:!0},_default:{againstWall:!0,bothSidesAccessible:!1}},E={sofa:"couch",sectional:"couch",loveseat:"couch",desk:"office_desk",table:"dining_table",bed_frame:"bed",mattress:"bed",armoire:"wardrobe",fridge:"refrigerator",freezer:"chest_freezer",washer:"washing_machine",stove:"range",oven:"range",exercise_bike:"spin_bike",stationary_bike:"spin_bike",rower:"rowing_machine"}
1,D={bed:"Headboard against wall, both sides accessible.",dining_table:"Centered in dining area, chairs on all sides.",office_desk:"Desk against wall, chair pullback space included.",wardrobe:"Against wall, door swing clearance included.",couch:"Against wall, walking-past clearance in front.",refrigerator:"Against wall, door swing clearance included.",washing_machine:"Against wall, door swing clearance included.",range:"Against wall, oven door clearance included.",treadmill:"Safety dismount zone behind, side clearance for emergency step-off.",power_rack:"Barbell loading zone in front, plate storage clearance on sides.",_default:"Item placed against one wall."},F={bed:[{assumption:"One side against wall (corner placement)",assumptionChange:{bothSidesAccessible:!1},note:"Only one side accessible for getting in/out of bed",applyToProfile:e=>({...e,left_mm:0})}],dining_table:[{assumption:"Against a wall (3-side access)",assumptionChange:{allSidesAccessible:!1},note:"Chairs on three sides only",applyToProfile:e=>({...e,back_mm:0,accessSides:["front","left","right"],placement:["floor","against_wall"]})}],office_desk:[{assumption:"Standing desk (no chair)",assumptionChange:{chairPullback:!1},note:"No chair pullback space needed",applyToProfile:e=>({...e,front_mm:457})}],wardrobe:[{assumption:"Sliding doors instead of hinged",assumptionChange:{doorSwingClearance:!1},note:"Sliding doors eliminate swing clearance",applyToProfile:e=>({...e,front_mm:457})}],refrigerator:[{assumption:"Built-in niche (reduced door swing)",assumptionChange:{doorSwingClearance:!1},note:"Counter-depth install reduces front clearance needed",applyToProfile:e=>({...e,front_mm:Math.round(24*25.4)})}],treadmill:[{assumption:"Against wall (no rear safety zone)",assumptionChange:{safetyZoneBehind:!1},note:"Reduces safety — not recommended but saves space",applyToProfile:e=>({...e,back_mm:Math.round(24*25.4)})}]};function C(e){let{axis:t,itemDim_mm:n,spaceDim_mm:i,tolerance_mm:a=0,prefix:o=[]}=e,r=(0,b.rc)({axis:t,spaceLimit_mm:i,margin_mm:i-n});return 0===r.length?o:(0,b.ke)([...o,...r],{tolerance_mm:a})}function O(e,t,n,i,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,m=[{rotated:!1,itemFloorW:e,itemFloorD:t,label:"0\xb0 (as-is)"},{rotated:!0,itemFloorW:t,itemFloorD:e,label:"90\xb0 rotated"}],c=!1;if(null!==s){if(0===s.length)return{bestPlacement:null,checkedOrientations:[],noValidOrientation:!0};let e=m.filter(e=>s.some(t=>25.4>Math.abs(e.itemFloorW-(t.w||0))&&25.4>Math.abs(e.itemFloorD-(t.d||0))));e.length>0?m=e:c=!0}let d=n===i?[{roomFloorW:n,roomFloorD:i,wallLabel:"",label:"length-wall"}]:[{roomFloorW:n,roomFloorD:i,wallLabel:n>i?"long wall":"short wall",label:"length-wall"},{roomFloorW:i,roomFloorD:n,wallLabel:i>n?"long wall":"short wall",label:"width-wall"}],h=[k.CENTERED,k.AGAINST_WALL_LEFT,k.AGAINST_WALL_RIGHT,k.FLOATING].filter(e=>!a.accessSides.includes("all")&&!!a.placement.includes("against_wall")||e.meta.allSidesAccessible),u=null,_=[];for(let e of m)for(let t of d){if(e.itemFloorW>t.roomFloorW||e.itemFloorD>t.roomFloorD){let n=t.wallLabel?"".concat(e.label,", ").concat(t.wallLabel):e.label;_.push({orientation:n,roomWall:t.label,feasible:!1,result:"too_large",itemFloor:"".concat(Math.round(e.itemFloorW),"\xd7").concat(Math.round(e.itemFloorD),"mm"),roomFloor:"".concat(Math.round(t.roomFloorW),"\xd7").concat(Math.round(t.roomFloorD),"mm")});continue}let n=o?w(o,t.roomFloorW,t.roomFloorD):null;for(let i of h){let o=N(e.itemFloorW,e.itemFloorD,t.roomFloorW,t.roomFloorD,i),s=g(a,i.meta,r,l),m={front:p(o.foot,s.front),back:p(o.head,s.back),left:p(o.left,s.left),right:p(o.right,s.right)},c=n?v({itemFloorW:e.itemFloorW,itemFloorD:e.itemFloorD,roomFloorW:t.roomFloorW,roomFloorD:t.roomFloorD,strategy:i},s,n):null,{verdict:d}=f(m,c),h=Object.entries(m).filter(e=>{let[,t]=e;return t!==1/0&&isFinite(t)}),w=h.length>0?Math.min(...h.map(e=>{let[,t]=e;return t})):1/0,b=t.wallLabel?"".concat(e.label,", ").concat(t.wallLabel):e.label;_.push({orientation:b,roomWall:t.label,strategy:i.id,feasible:"DOESNT_FIT"!==d,walkways:{...o},min_walkway_mm:o.min_walkway_mm,ratios:m,worstRatio:w,doorConflict:c||null}),(!u||w>u.worstRatio)&&(u={rotated:e.rotated,orientationLabel:e.label,roomWall:t.label,strategy:i,walkways:o,min_walkway_mm:o.min_walkway_mm,itemFloorW:e.itemFloorW,itemFloorD:e.itemFloorD,roomFloorW:t.roomFloorW,roomFloorD:t.roomFloorD,ratios:m,worstRatio:w,effectiveRequired:s,doorConflict:c||null})}}if(e!==t){let n=Math.PI/180,i=null,s=-1/0;for(let a=1;a<90;a++){let o=a*n,r=Math.cos(o),l=Math.sin(o),m=e*r+t*l,c=e*l+t*r;for(let e of d)if(m<=e.roomFloorW&&c<=e.roomFloorD){let t=Math.min(e.roomFloorW-m,e.roomFloorD-c);t>s&&(s=t,i=a)}}if(null!==i){let s=i*n,m=e*Math.cos(s)+t*Math.sin(s),c=e*Math.sin(s)+t*Math.cos(s),h=d.find(e=>m<=e.roomFloorW&&c<=e.roomFloorD)||d[0],b=k.CENTERED,y=N(m,c,h.roomFloorW,h.roomFloorD,b),T=g(a,b.meta,r,l),I={front:p(y.foot,T.front),back:p(y.head,T.back),left:p(y.left,T.left),right:p(y.right,T.right)},M=o?w(o,h.roomFloorW,h.roomFloorD):null,S=M?v({itemFloorW:m,itemFloorD:c,roomFloorW:h.roomFloorW,roomFloorD:h.roomFloorD,strategy:b},T,M):null,{verdict:x}=f(I,S),E=Object.entries(I).filter(e=>{let[,t]=e;return t!==1/0&&isFinite(t)}
1),D=E.length>0?Math.min(...E.map(e=>{let[,t]=e;return t})):1/0,F="".concat(i,"\xb0 diagonal");_.push({orientation:F,roomWall:h.label,strategy:b.id,feasible:"DOESNT_FIT"!==x,walkways:{...y},min_walkway_mm:y.min_walkway_mm,ratios:I,worstRatio:D,doorConflict:S||null,diagonal:!0,angle_deg:i,boundingBox:{width:Math.round(m),depth:Math.round(c)}}),(!u||D>u.worstRatio)&&(u={rotated:!1,orientationLabel:F,roomWall:h.label,strategy:b,walkways:y,min_walkway_mm:y.min_walkway_mm,itemFloorW:m,itemFloorD:c,roomFloorW:h.roomFloorW,roomFloorD:h.roomFloorD,ratios:I,worstRatio:D,effectiveRequired:T,doorConflict:S||null,diagonal:!0,angle_deg:i})}else _.push({orientation:"diagonal (1\xb0–89\xb0)",feasible:!1,result:"no_angle_fits",itemFloor:"".concat(Math.round(e),"\xd7").concat(Math.round(t),"mm"),roomFloor:"".concat(Math.round(d[0].roomFloorW),"\xd7").concat(Math.round(d[0].roomFloorD),"mm")})}return{bestPlacement:u,checkedOrientations:_,orientationFilterIgnored:c}}let R={DOESNT_FIT:0,FITS_VERY_TIGHT:1,FITS_TIGHT:2,FITS:3};function A(e,t){var n,a,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"room_solver",limiting_constraint:"missing_data",checked_orientations:[],assumptions:["Missing item or room dimensions"],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",needs_user_input:e?["Room dimensions (length x width x height)"]:["Item dimensions (length x width x height)"]};let g=e.length||0,p=e.width||0,w=e.height||0,v=t.length||0,I=t.width||0,M=t.height||0;if(!g&&!p||!v&&!I||g<=0||p<=0||v<=0||I<=0){let e=[];return(g<=0||p<=0)&&e.push("Complete item dimensions (length \xd7 width)"),(v<=0||I<=0)&&e.push("Complete room dimensions (length \xd7 width)"),{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"room_solver",limiting_constraint:"missing_data",checked_orientations:[],assumptions:["Incomplete dimensions provided — need both floor dimensions for item and room"],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",needs_user_input:e.length>0?e:["Complete dimensions for both item and room"]}}let k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return{..._};let n=c[e]||e,i=function(e){for(let i of m){var t,n;let a=null==(t=i.items)?void 0:t[e];if(a&&(null==(n=a.standardSizes)?void 0:n.length)>0)return a}return null}(n);if(!i)return{..._};let a=null;if(t){let e=t.toLowerCase().trim(),o=d[n];o&&o[e]&&(a=i.standardSizes.find(t=>t.id===o[e])),a||(a=i.standardSizes.find(t=>t.id.includes(e)||t.label.toLowerCase().includes(e)))}a||(a=i.standardSizes[0]);let o=a.clearances||{},r=i.placement||["floor","against_wall"],l=!r.includes("against_wall"),s=Math.round(25.4*(o.front||0)),g=Math.round(25.4*(o.sides||0)),p=Math.round(25.4*(o.back||0)),f=h[n]||null,w=u[n]||null,v=[];return(s>0&&v.push("front"),g>0&&(v.push("left"),v.push("right")),p>0&&v.push("back"),l)?{front_mm:s,left_mm:g,right_mm:g,back_mm:p,placement:r,accessSides:["all"],swingZones:f,operationalZones:w}:(0===v.length&&v.push("front"),{front_mm:s,left_mm:g,right_mm:g,back_mm:p,placement:r,accessSides:v,swingZones:f,operationalZones:w}
1)}(e.furnitureType,r.sizeHint||null),N=E[e.furnitureType]||e.furnitureType||null,A=N&&x[N]||x._default,L=N&&D[N]||D._default,P=r.doorInfo||null,U=r.roomType||null,H=U&&s[U]||null,W=r.comfortProfile||(null==H?void 0:H.defaultComfortProfile)||"standard",G=null!=(a=null==(n=l[W])?void 0:n.multiplier)?a:1,q=(null==H?void 0:H.defaultCirculation_mm)||0;if(w>0&&M>0&&w>M){let e=v*I>0?Math.round(g*p/(v*I)*1e3)/1e3:0,t=C({axis:"room_height",itemDim_mm:w,spaceDim_mm:M,tolerance_mm:0,prefix:[{id:"coverage_ratio",passed:e<=1,limiting:!1,values:{footprint_mm2:Math.round(g*p),room_mm2:Math.round(v*I),coverage_ratio:e}}]}),n=Math.sqrt(v**2+I**2+M**2);return t.push(...(0,b.kj)({itemFace:{a_mm:Math.max(g,p),b_mm:w},spaceFace:{a_mm:Math.max(v,I),b_mm:M},itemReach:{l_mm:g,w_mm:p,h_mm:w},spaceReachDiag_mm:n,fits:!1})),{verdict:"DOESNT_FIT",margin_mm:-(w-M),confidence:"HIGH",method:"room_solver",limiting_constraint:"ceiling",proofSteps:t,checked_orientations:[{orientation:"upright",result:"ceiling_exceeded"}],assumptions:[],tolerance_mm:0,showVisualization:!0,queryType:"room_fit",tightestPoint:{entityA:"item_height",entityB:"room_height",axis:"height",clearance_mm:-(w-M)},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["standard_furniture_placement","item_rigid"],details:{reason:"ceiling",itemHeight_mm:w,roomHeight_mm:M,excess_mm:w-M}}}let{bestPlacement:j,checkedOrientations:z,noValidOrientation:V,orientationFilterIgnored:B}=O(g,p,v,I,k,P,G,q,(null==r?void 0:r.allowedOrientations)!==void 0?r.allowedOrientations:null);if(V){let e=[g,p].sort((e,t)=>t-e),t=[v,I].sort((e,t)=>t-e),n=e[0]>t[0],i=e[1]>t[1],a=Math.sqrt(v**2+I**2+M**2),o=v*I>0?Math.round(g*p/(v*I)*1e3)/1e3:0,r={id:"coverage_ratio",passed:o<=1,limiting:!1,values:{footprint_mm2:Math.round(g*p),room_mm2:Math.round(v*I),coverage_ratio:o}};if(n||i){let i=n?e[0]:e[1],o=n?t[0]:t[1],l=C({axis:n?"room_long":"room_short",itemDim_mm:i,spaceDim_mm:o,tolerance_mm:0,prefix:[r]});return l&&0!==l.length||(l=[r]),l.push(...(0,b.kj)({itemFace:{a_mm:e[0],b_mm:e[1]},spaceFace:{a_mm:t[0],b_mm:t[1]},itemReach:{l_mm:g,w_mm:p,h_mm:w},spaceReachDiag_mm:a,fits:!1})),{verdict:"DOESNT_FIT",margin_mm:Math.round(o-i),confidence:"HIGH",method:"room_solver",limiting_constraint:"floor_area",checked_orientations:[],assumptions:["No placement orientation was permitted; the item also exceeds the room floor."],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",proofSteps:l}}return{verdict:"DOESNT_FIT",margin_mm:null,confidence:"LOW",method:"room_solver",limiting_constraint:"no_permitted_orientation",checked_orientations:[],assumptions:["No placement orientation was permitted by the caller.","The item's footprint (".concat(Math.round(g),"\xd7").concat(Math.round(p),"mm) does fit the room floor (").concat(Math.round(v),"\xd7").concat(Math.round(I),"mm) — the block is the orientation constraint, not the room's size.")],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",proofSteps:[]}}if(!j){let t=[g,p].sort((e,t)=>t-e),n=[v,I].sort((e,t)=>t-e),i=t[0]>n[0],a=i?t[0]:t[1],o=i?n[0]:n[1],r=v*I>0?Math.round(g*p/(v*I)*1e3)/1e3:0,l=C({axis:i?"room_long":"room_short",itemDim_mm:a,spaceDim_mm:o,tolerance_mm:0,prefix:[{id:"coverage_ratio",passed:r<=1,values:{footprint_mm2:Math.round(g*p),room_mm2:Math.round(v*I),coverage_ratio:r}}]}),s=Math.sqrt(v**2+I**2+M**2);l.push(...(0,b.kj)({itemFace:{a_mm:t[0],b_mm:t[1]},spaceFace:{a_mm:n[0],b_mm:n[1]},itemReach:{l_mm:g,w_mm:p,h_mm:w},spaceReachDiag_mm:s,fits:!1}));let m=Math.round(o-a),c=m<0?m:null;return{verdict:"DOESNT_FIT",margin_mm:c,confidence:"HIGH",method:"room_solver",limiting_constraint:"floor_area",proofSteps:l,checked_orientations:z,assumptions:[],tolerance_mm:0,showVisualization:!0,queryType:"room_fit",tightestPoint:{entityA:"item_footprint",entityB:"room_floor",axis:"floor_area",entityA_mm:Math.round(a),entityB_mm:Math.round(o),clearance_mm:c},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["standard_furniture_placement","item_rigid"],details:{reason:"floor_area",itemDims:{length:g,width:p},roomDims:{length:v,width:I},furnitureType:e.furnitureType||null}}}
1let{verdict:Y,tone:K,worstRatio:$,limitingSide:X}=f(j.ratios,j.doorConflict),Q=(null==r?void 0:r.preferredUnit)==="mm"||(null==r?void 0:r.preferredUnit)==="cm"?r.preferredUnit:"in",J="in"!==Q,Z=e=>J?"cm"===Q?"".concat(Math.round(e/10)," cm"):"".concat(Math.round(e)," mm"):"".concat(Math.round(e/25.4),'"'),ee=P?function(e){if(!e||!e.width_mm||e.width_mm<=0)return null;let t=e.width_mm,n=Number.isFinite(e.swingAngleDeg)&&e.swingAngleDeg>0?e.swingAngleDeg:90;return{area_mm2:Math.round(Math.PI*t*t*(n/360)),radius_mm:t,arc_degrees:n,consumesInteriorFloor:"outward"!==e.swingDirection}}(P):null,et=[];if(B&&et.push("The way the item has to be carried in does not match how it rests, so it is turned upright once inside; the carry orientation does not constrain the placement."),P){let e,t=P.width_mm;et.push("Door: ".concat(P.position||"center"," position, ").concat(Z(t)," wide, swings ").concat(P.swingDirection||"inward")),ee&&ee.consumesInteriorFloor&&et.push("Door swing needs ".concat((e=ee.area_mm2,J?"".concat((e/1e6).toFixed(2)," m\xb2"):"".concat((e/92903.04).toFixed(1)," ft\xb2"))," of floor clearance (").concat(ee.arc_degrees,"\xb0 arc, ").concat(Z(ee.radius_mm)," radius)"))}if(H){let e=H.defaultCirculation_mm;et.push("Room type: ".concat(H.label," (min circulation: ").concat(Z(e),")"))}let en=null!=(o=null==H?void 0:H.defaultCirculation_mm)?o:914;et.push("".concat(Z(en)," primary walkway minimum (ADA-style guideline, not code)"));let ei="true"===T.env.IRREGULAR_GEOMETRY_LIVE&&"l_shape"===e.shape&&Array.isArray(e.footprint)&&2===e.footprint.length,ea=ei?(0,y.mp)(e.footprint):Math.round(j.itemFloorW*j.itemFloorD),eo=Math.round(j.roomFloorW*j.roomFloorD),er=eo>0?Math.round(ea/eo*1e3)/1e3:0,el=j.walkways,es=[Math.round(el.left),Math.round(el.right),Math.round(el.foot),Math.round(el.head)],em=Math.round(j.min_walkway_mm),ec="DOESNT_FIT"===Y?"DOESNT_FIT":"FITS_VERY_TIGHT"===Y||"FITS_TIGHT"===Y?"TIGHT":"FITS",ed=X?Math.round(j.effectiveRequired[X]||0):0,eh=X?Math.round(j.walkways[({front:"foot",back:"head",left:"left",right:"right"})[X]]||0):em,eu=[{id:"coverage_ratio",passed:er<=1,values:{footprint_mm2:ea,room_mm2:eo,coverage_ratio:er}},{id:"per_side_walkway",passed:"DOESNT_FIT"!==Y,values:{clearances_mm:es,min_walkway_mm:em,binding_constraint:X||"none",required_walkway_mm:ed},comparison:{actual_mm:eh,limit_mm:ed,margin_mm:eh-ed},limiting:!0},{id:"walkway_threshold",passed:"DOESNT_FIT"!==ec,values:{min_walkway_mm:em,tier:ec,required_walkway_mm:ed,tier_doesnt_fit_mm:Math.round(.5*ed),tier_tight_mm:Math.round(.75*ed),tier_fits_mm:ed}}];if(ei){eu.push((0,y.Gv)({footprint_area_mm2:ea,room_area_mm2:eo})),et.push("Modeled as its L-shaped footprint (two rectangles), not its bounding box.");let e=Math.round(j.itemFloorW*j.itemFloorD);i.U.log("[IRREGULAR-FOOTPRINT]",JSON.stringify({solver:"room",bbox_mm2:e,footprint_mm2:ea,shrink_pct:e>0?Math.round((1-ea/e)*100):0,coverage_ratio:er}))}if(j.doorConflict){let e=+!!j.doorConflict.conflicts;eu.push({id:"door_swing_intersection",passed:!j.doorConflict.blocksRequiredClearance,values:{overlap_conflict:e,swing_area_mm2:ee?ee.area_mm2:null,swing_arc_degrees:ee?ee.arc_degrees:null,swing_radius_mm:ee?ee.radius_mm:null}})}let e_=j.doorConflict?.5*!j.doorConflict.blocksRequiredClearance:1,eg=j.walkways?Object.values(j.walkways).filter(e=>"number"==typeof e&&e>0).length/4:0,ep=Number.isFinite($)?Math.round(1e3*$)/1e3:1,ef=!!j.doorConflict;if(eu.push({id:"placement_score",passed:"DOESNT_FIT"!==Y,values:{coverage:er,walkway:Number.isFinite($)?Math.round(1e3*$)/1e3:1,swing:e_,access:Math.round(1e3*eg)/1e3,placement_score:ep,factors:S({coverage:er,walkwayRatio:Number.isFinite($)?$:1,swing:e_,access:eg,verdict:Y,modeledSwing:ef,modeledAccess:!0}),headline:{value:ep,kind:"clearance_ratio"}},limiting:!1}),X){let e="left"===X||"right"===X,t=j.effectiveRequired,n=e?j.itemFloorW:j.itemFloorD,i=e?j.roomFloorW:j.roomFloorD,a=e?t.left+t.right:t.front+t.back;eu.push(...(0,b.Ew)({limitingAxis:e?"room_width":"room_depth",itemDim_mm:n,spaceDim_mm:i,tolerance_mm:a}))}let ew="".concat(j.orientationLabel," (").concat(j.strategy.label,") wins on placement_score (Step ").concat(eu.length,")."),ev="FITS"===Y&&$>=1?[]:function(e,t,n,i,a,o,r){var l,s;let m=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,d=F[o];if(!d||0===d.length)return[];let h=null!=(l=R[r])?l:-1,u=[];for(let o of d){let{bestPlacement:r}=O(e,t,n,i,o.applyToProfile({...a}),null,m,c);if(!r)continue;let{verdict:l,worstRatio:d}=f(r.ratios);(null!=(s=R[l])?s:-1)>h&&u.push({assumption:o.assumption,assumptionChange:o.assumptionChange,verdict:l,worstRatio:d,note:o.note})}return u}(g,p,v,I,k,N,Y,G,q),eb="DOESNT_FIT"===Y?-j.min_walkway_mm:j.min_walkway_mm,ey=Array.isArray(null==r?void 0:r.unhandledItems)?r.unhandledItems:[];if(ey.length>0&&"DOESNT_FIT"!==Y){let t=ey.join(", "),n=(null==e?void 0:e.name)||(null==e?void 0:e.furnitureType)||"the first item",i="Partial analysis — only ".concat(n," was evaluated. ")+"Additional items you mentioned were not checked: ".concat(t,". ")+"Please provide dimensions for those items so we can verify the full set fits.";return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"room_solver",limiting_constraint:"incomplete_item_set",checked_orientations:z,assumptions:[i,...et],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",partialAnalysis:!0,unhandledItems:ey,evaluatedItem:n,underlyingVerdict:Y,underlyingMargin_mm:eb,needs_user_input:ey.map(e=>"Dimensions for ".concat(e)),warnings:[i],message:i,details:{reason:"partial_analysis",ignoredItems:ey,evaluatedItem:n}}}return{verdict:Y,margin_mm:eb,marginBasis:"linear_clearance",confidence:"HIGH",method:"room_solver",limiting_constraint:"walkway",checked_orientations:z,assumptions:et,tolerance_mm:0,showVisualization:!0,queryType:"room_fit",tone:K,tightestPoint:{entityA:"item_footprint",entityB:"room_walkway",axis:X||"walkway",clearance_mm:eb},geometryClass:"room",enrichedConfidence:"high",enrichedAssumptions:["standard_furniture_placement","item_rigid"],details:{walkways:j.walkways,strategy:j.strategy.id,strategyDesc:j.strategy.label,rotated:j.rotated,orientationLabel:j.orientationLabel,roomWall:j.roomWall,min_walkway_mm:j.min_walkway_mm,walkwayPercent:Number.isFinite($)?Math.max(0,Math.min(200,Math.round(($-1)*100))):null,itemFloor:{width:j.itemFloorW,depth:j.itemFloorD},roomFloor:{width:j.roomFloorW,depth:j.roomFloorD},ceilingClearance_mm:M>0&&w>0?M-w:null,furnitureType:e.furnitureType||null,ratios:j.ratios,worstRatio:$,limitingSide:X,effectiveRequired:j.effectiveRequired,profileUsed:{front_mm:k.front_mm,left_mm:k.left_mm,right_mm:k.right_mm,back_mm:k.back_mm,placement:k.placement,accessSides:k.accessSides},doorConflict:j.doorConflict||null,doorSwing:ee,comfortProfile:"standard"!==W?{key:W,...l[W]||{}}:null,layoutAssumptions:A,assumptionDescription:L,alternatives:ev,roomProfile:H?{roomType:U,label:H.label,defaultCirculation_mm:H.defaultCirculation_mm}:null},proofSteps:eu,orientationRationale:ew,itemDims_mm:{length:g,width:p,height:w},spaceDims_mm:{room_length_mm:v,room_width_mm:I,room_height_mm:M}}}let L={DOESNT_FIT:0,FITS_VERY_TIGHT:1,FITS_TIGHT:2,FITS:3};function P(e,t){var n,i,a,o;let r,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(null==e?void 0:e.length)||!t)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"room_solver_multi",limiting_constraint:"missing_data",checked_orientations:[],assumptions:["Missing items or room dimensions"],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",needs_user_input:(null==e?void 0:e.length)?["Room dimensions (length \xd7 width)"]:["Item dimensions"]};let s=t.length||0,m=t.width||0,c=t.height||0;if(s<=0||m<=0)return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"room_solver_multi",limiting_constraint:"missing_data",checked_orientations:[],assumptions:[],tolerance_mm:0,showVisualization:!1,queryType:"room_fit",needs_user_input:["Complete room dimensions (length \xd7 width)"]};let d=s*m,h=[],u=0,_="FITS",g=0,p=null,f=null;for(let a=0;a<e.length;a++){let o=e[a],r=o.length||0,d=o.width||0,w=o.height||0;if(r<=0||d<=0){h.push({name:o.name||"Item ".concat(a+1),verdict:"CLARIFY",reason:"missing_dimensions",footprint_mm2:0});continue}if(w>0&&c>0&&w>c){p=p||{itemIndex:a,name:o.name||"Item ".concat(a+1),itemName:o.name||"Item ".concat(a+1),excess_mm:w-c,height_mm:w},h.push({name:o.name||"Item ".concat(a+1),verdict:"DOESNT_FIT",reason:"ceiling",excess_mm:w-c,footprint_mm2:r*d,dimensions_mm:{length:r,width:d,height:w}}),_="DOESNT_FIT",g=a;continue}{let e=r<=s&&d<=m,t=d<=s&&r<=m;if(!e&&!t){f=f||{itemIndex:a,itemName:o.name||"Item ".concat(a+1)},h.push({name:o.name||"Item ".concat(a+1),verdict:"DOESNT_FIT",reason:"floor_area",footprint_mm2:r*d,dimensions_mm:{length:r,width:d,height:w}}),_="DOESNT_FIT",g=a;continue}}let v=Math.min(r,d)*Math.max(r,d);u+=v;let b=A(o,t,l);h.push({name:o.name||"Item ".concat(a+1),verdict:b.verdict,margin_mm:b.margin_mm,footprint_mm2:v,dimensions_mm:{length:r,width:d,height:w},furnitureType:o.furnitureType||null,singleSolverResult:b}),(null!=(n=L[b.verdict])?n:3)<(null!=(i=L[_])?i:3)&&(_=b.verdict,g=a)}let w=d-u,v=d>0?Math.round(w/d*100):0;r=p||f?"DOESNT_FIT":v>=30?"FITS":v>=20?"FITS_TIGHT":v>=10?"FITS_VERY_TIGHT":"DOESNT_FIT",(null!=(a=L[_])?a:3)<(null!=(o=L[r])?o:3)&&(r=_);let b=2*(s+m),y=b>0?Math.round(w/b):0,T=h.filter(e=>e.footprint_mm2>0).sort((e,t)=>
1t.footprint_mm2-e.footprint_mm2)[0],I=h.map(e=>e.name),M=(null==T?void 0:T.name)||I[0]||"Items",k=e.length<=3?I.join(", "):"".concat(I.slice(0,2).join(", ")," +").concat(e.length-2," more"),N=d>0?Math.round(u/d*1e3)/1e3:0,x="DOESNT_FIT"===r?"DOESNT_FIT":"FITS_VERY_TIGHT"===r||"FITS_TIGHT"===r?"TIGHT":"FITS",E=Math.max(0,Math.min(1,v/100)),D=[{id:"coverage_ratio",passed:N<=1,values:{footprint_mm2:u,room_mm2:d,coverage_ratio:N}},{id:"free_floor_area",passed:"DOESNT_FIT"!==r,values:{room_mm2:d,footprint_mm2:u,free_floor_mm2:w,free_floor_pct:v,tier:x,tier_fits_pct:30,tier_tight_pct:20,tier_very_tight_pct:10},limiting:!1,note:"Multi-item placement is judged on the share of floor left free, not on a measured walkway. Items are not collision-tested against each other."},{id:"placement_score",passed:"DOESNT_FIT"!==r,values:{coverage:N,walkway:E,swing:1,access:1,placement_score:E,factors:S({coverage:N,walkwayRatio:E,swing:1,access:1,verdict:r,modeledSwing:!1,modeledAccess:!1}),headline:{value:E,kind:"free_floor_fraction"}},limiting:!1}],F=h.map((e,t)=>{var n,i,a,o,r,l;let s=e.singleSolverResult||null,m={verdict:e.verdict,margin_mm:null!=(i=null!=(n=e.margin_mm)?n:null==s?void 0:s.margin_mm)?i:null,limiting_constraint:null!=(o=null!=(a=e.reason)?a:null==s?void 0:s.limiting_constraint)?o:p?"ceiling":f?"floor_area":"walkway",confidence:null!=(r=null==s?void 0:s.confidence)?r:"MEDIUM",checked_orientations:null!=(l=null==s?void 0:s.checked_orientations)?l:[]};return(null==s?void 0:s.proofSteps)&&(m.proofSteps=s.proofSteps),(null==s?void 0:s.tightestPoint)&&(m.tightestPoint=s.tightestPoint),(null==s?void 0:s.itemDims_mm)&&(m.itemDims_mm=s.itemDims_mm),(null==s?void 0:s.spaceDims_mm)&&(m.spaceDims_mm=s.spaceDims_mm),(null==s?void 0:s.itemDimSource)&&(m.itemDimSource=s.itemDimSource),(null==s?void 0:s.spaceDimSource)&&(m.spaceDimSource=s.spaceDimSource),(null==s?void 0:s.tolerance_mm)!=null&&(m.tolerance_mm=s.tolerance_mm),(null==s?void 0:s.orientationRationale)&&(m.orientationRationale=s.orientationRationale),(null==s?void 0:s.marginRange)&&(m.marginRange=s.marginRange),(null==s?void 0:s.pFit)!=null&&(m.pFit=s.pFit),m});return{verdict:r,margin_mm:null,marginBasis:"floor_area",confidence:"MEDIUM",method:"room_solver_multi",limiting_constraint:p?"ceiling":f?"floor_area":"walkway",checked_orientations:[],assumptions:["".concat(e.length," items placed together in room")],tolerance_mm:0,showVisualization:!0,queryType:"room_fit",recommendation:p?"".concat(p.name," is too tall for the room ceiling."):f?"All ".concat(e.length," items take up ").concat(100-v,"% of the floor — not enough room to walk."):v>=30?"".concat(e.length," items use ").concat(100-v,"% of the floor, leaving ").concat(v,"% free — a comfortable amount of open floor."):v>=20?"".concat(e.length," items leave ").concat(v,"% free floor. Functional but tight — plan your layout carefully."):"".concat(e.length," items leave only ").concat(v,"% free floor. ").concat(M," is the largest piece — consider a smaller alternative."),...p?{tightestPoint:{entityA:p.name,entityA_mm:p.height_mm||0,entityB:"ceiling",entityB_mm:c,axis:"height",clearance_mm:-p.excess_mm}}:{},geometryClass:"room",enrichedConfidence:"medium",enrichedAssumptions:["standard_furniture_placement","item_rigid","multi_item_footprint"],perItemResults:h,itemResults:F,worstItemIndex:g,itemLabel:k,tightestItemName:M,details:{reason:p?"ceiling":f?"floor_area":"walkway",roomFloor:{width:m,depth:s,...c>0?{height:c}:{}},totalFootprint_mm2:u,roomArea_mm2:d,remainingArea_mm2:w,walkwayPercent:v,avgWalkway_mm:y,itemCount:e.length,ceilingFail:p,floorFail:f,perItemFootprints:h.map(e=>({name:e.name,footprint_mm2:e.footprint_mm2,verdict:e.verdict,furnitureType:e.furnitureType}))},proofSteps:D,spaceDims_mm:{room_length_mm:s,room_width_mm:m,...c>0?{room_height_mm:c}:{}}}}},90836:(e,t,n)=>{function i(e){return r(String(null!=e?e:"")).slice(0,8)}n.d(t,{f:()=>r,k:()=>i});let a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
176c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]);function o(e,t){return e>>>t|e<<32-t}function r(e){let t=new TextEncoder().encode(e),n=0x6a09e667,i=0xbb67ae85,r=0x3c6ef372,l=0xa54ff53a,s=0x510e527f,m=0x9b05688c,c=0x1f83d9ab,d=0x5be0cd19,h=t.length,u=8*h,_=h+1,g=_+(56-_%64+64)%64+8,p=new Uint8Array(g);p.set(t),p[h]=128;let f=new DataView(p.buffer);f.setUint32(g-8,Math.floor(u/0x100000000)>>>0,!1),f.setUint32(g-4,u>>>0,!1);let w=new Uint32Array(64);for(let e=0;e<g;e+=64){for(let t=0;t<16;t++)w[t]=f.getUint32(e+4*t,!1);for(let e=16;e<64;e++){let t=o(w[e-15],7)^o(w[e-15],18)^w[e-15]>>>3,n=o(w[e-2],17)^o(w[e-2],19)^w[e-2]>>>10;w[e]=w[e-16]+t+w[e-7]+n>>>0}let t=n,h=i,u=r,_=l,g=s,p=m,v=c,b=d;for(let e=0;e<64;e++){let n=b+(o(g,6)^o(g,11)^o(g,25))+(g&p^~g&v)+a[e]+w[e]>>>0,i=(o(t,2)^o(t,13)^o(t,22))+(t&h^t&u^h&u)>>>0;b=v,v=p,p=g,g=_+n>>>0,_=u,u=h,h=t,t=n+i>>>0}n=n+t>>>0,i=i+h>>>0,r=r+u>>>0,l=l+_>>>0,s=s+g>>>0,m=m+p>>>0,c=c+v>>>0,d=d+b>>>0}return[n,i,r,l,s,m,c,d].map(e=>e.toString(16).padStart(8,"0")).join("")}},91027:(e,t,n)=>{n.d(t,{Pg:()=>l,Ty:()=>s,dg:()=>o,i0:()=>a,kB:()=>m});let i={sofa:160,couch:160,bed:120,mattress:80,table:200,desk:180,dresser:220,piano:400,bookshelf:200,wardrobe:180,cabinet:200,chair:150};function a(e){if(!e)return null;if(null!=e.weight_kg)return e.weight_kg;let t=e.width_mm,n=e.depth_mm,a=e.height_mm;return null==t||null==n||null==a?null:Math.round(t/1e3*(n/1e3)*(a/1e3)*(i[(e.furnitureType||e.type||"").toLowerCase()]||150)*4)/10}function o(e,t){let n;return null==e?null:(n=e<25?1:e<=60?2:3,"precision"===t&&e>=25&&(n+=1),("tight"===t||"precision"===t)&&n<2&&(n=2),n)}function r(e,t){return null!=e&&e>0&&null!=t&&t>0?Math.round(9.80665*e/(t/1e6)/1e3*10)/10:null}function l(e,t){let n=r(e,t);return null==n||n<1.92?null:n>=5?{pressure_kpa:n,severity:"warning",note:"Heavy concentrated load (~".concat(n," kPa over its footprint) — well above a typical residential floor rating (~").concat(1.92," kPa). Spread the weight (a sheet of plywood or a dolly) and check the floor structure, especially on suspended or upper floors.")}:{pressure_kpa:n,severity:"caution",note:"Concentrated load (~".concat(n," kPa over its footprint) near the typical residential floor rating (~").concat(1.92," kPa). On soft flooring, legs or casters can dent — use pads or a spreader.")}}function s(e){let{weight_kg:t,weightKnown:n,rated_capacity_kg:i,contextLabel:a="this space"}=e;if(null==t||!(t>0)||null==i||!(i>0))return null;let o=Math.round(t/i*100)/100,r=n?"".concat(Math.round(t)," kg"):"~".concat(Math.round(t)," kg (estimated)"),l="".concat(Math.round(i)," kg");return o>=1?{ratio:o,status:"exceeded",hard:!!n,note:n?"Too heavy: ".concat(r," exceeds the rated capacity of ").concat(a," (~").concat(l,"). It fits dimensionally but cannot be carried this way — check the posted capacity or use a freight elevator / professional movers."):"Possible weight problem: ".concat(r," is at or above the typical rated capacity of ").concat(a," (~").concat(l,"). Confirm the posted weight limit before relying on it.")}:o>=.8?{ratio:o,status:"near",hard:!1,note:"Near the weight limit: ".concat(r," is close to the typical rated capacity of ").concat(a," (~").concat(l,"). Confirm the posted limit.")}:{ratio:o,status:"ok",hard:!1,note:null}}function m(e){var t;let n,i,a,s,{margin_mm:m,item_weight_kg:c,path_length_mm:d,constraining_dim_mm:h,item_dims_mm:u}=e,_=d>0&&m>0?180/Math.PI*Math.atan(m/d):0,g=Math.min(40,m/100*40);n=null==c?15:c<=15?30:c<=40?30-(c-15)/25*15:c<=80?15-(c-40)/40*10:Math.max(0,5-(c-80)/40*5),i=d<=500?20:d<=2e3?20-(d-500)/1500*12:d<=4e3?8-(d-2e3)/2e3*6:Math.max(0,2-(d-4e3)/2e3*2),a=_>=5?10:_>=1?4+(_-1)/4*6:4*_;let p=function(e){if(!Array.isArray(e))return null;let t=e.filter(e=>"number"==typeof e&&e>0);if(t.length<2)return null;let n=Math.max(...t),i=Math.min(...t);return i<=0?null:Math.round(n/i*100)/100}(u),f=0;null!=p&&(f=p<=3?0:p<=6?(p-3)/3*8:Math.min(12,8+(p-6)/6*4));let w=Math.max(0,g+n+i+a-f);s=w>=60?"easy":w>=35?"moderate":w>=15?"tight":"precision";let v=Array.isArray(u)&&u[0]>0&&u[1]>0?u[0]*u[1]:null,b=r(c,v),y=l(c,v),T=o(c,s),I=!(_<1&&null!=c&&c>20&&d>1500),M=null;return I?"precision"===s?M="Near-zero margin — requires precise alignment and careful handling throughout.":"tight"===s?M="Tight clearance — protect edges and move slowly through the constrained section.":null!=p&&p>=6&&(M="Long, awkward shape — expect to pivot and angle it through; an extra hand helps with control."):M="Extremely tight tolerances with a heavy item over a long path. Professional movers or disassembly strongly recommended.",{tier:s,practicallyFeasible:I,angularPrecision_deg:Math.round(100*_)/100,peopleCount:T,aspectRatio:p,floorLoadPressure_kpa:b,floorLoadNote:null!=(t=null==y?void 0:y.note)?t:null,guid
1ance:M}}},91309:(e,t,n)=>{n.d(t,{h:()=>o,t:()=>a});let i=new Set(["CLARIFY","UNKNOWN","INCOMPLETE","DIMENSION_INFO","NEEDS_MORE_INFO","INSUFFICIENT_CERTAINTY","NO_SOLVER_MATCH"]);function a(e){return"string"==typeof e&&i.has(e.trim().toUpperCase())}function o(e){return"string"==typeof e&&""!==e.trim()&&!a(e)}},91519:(e,t,n)=>{n.d(t,{$Z:()=>s,Q8:()=>c,aA:()=>d,eL:()=>m});var i=n(20251),a=n(95704);let o=void 0!==a?a.env:{},r={free:{id:"free",name:"Free",fitChecks:i.ds,visualProofs:i.q7,priceCents:0,priceDisplay:"$0",oneTime:!0,description:"".concat(i.ds," fit check").concat(1===i.ds?"":"s"," + ").concat(i.q7," visual proof, then 1 free fit check every 7 days at zero balance.")},single_project:{id:"single_project",name:"Plan Ahead",fitChecks:15,visualProofs:5,priceCents:999,priceDisplay:"$9.99",oneTime:!0,description:"Check every item in a move or renovation — not just the one you are stuck on.",stripePriceId:o.STRIPE_PRICE_SINGLE_PROJECT||null},unlimited:{id:"unlimited",name:"Unlimited",unlimited:!0,fitChecks:1/0,visualProofs:1/0,priceCents:2999,priceDisplay:"$29.99",oneTime:!0,popular:!0,description:"One payment, no subscription — check anything, anytime.",stripePriceId:o.STRIPE_PRICE_UNLIMITED||null},project_continue:{id:"project_continue",name:"Continue This Check",fitChecks:3,visualProofs:0,priceCents:299,priceDisplay:"$2.99",oneTime:!0,contextualOnly:!0,description:"Keep going on this project.",stripePriceId:o.STRIPE_PRICE_PROJECT_CONTINUE||null}},l={micro:{id:"micro",name:"Micro (legacy)",fitChecks:12,visualProofs:3,priceCents:300,priceDisplay:"$3",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_MICRO||null},lite:{id:"lite",name:"Lite (legacy)",fitChecks:35,visualProofs:10,priceCents:900,priceDisplay:"$9",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_LITE||null},pro:{id:"pro",name:"Pro (legacy)",fitChecks:200,visualProofs:50,priceCents:4900,priceDisplay:"$49",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_PRO||null},proplus:{id:"proplus",name:"Pro+ (legacy)",fitChecks:450,visualProofs:120,priceCents:9900,priceDisplay:"$99",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_PROPLUS||null},max:{id:"max",name:"Max (legacy)",fitChecks:1e3,visualProofs:300,priceCents:19900,priceDisplay:"$199",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_MAX||null},quick:{id:"quick",name:"Quick Check (legacy)",fitChecks:5,visualProofs:2,priceCents:700,priceDisplay:"$7",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_QUICK||null}
1,decision:{id:"decision",name:"Decision Pack (legacy)",fitChecks:12,visualProofs:4,priceCents:1700,priceDisplay:"$17",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_DECISION||null},project:{id:"project",name:"Project Pack (legacy)",fitChecks:50,visualProofs:15,priceCents:4900,priceDisplay:"$49",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_PROJECT||null},team:{id:"team",name:"Pro Pack (legacy)",fitChecks:125,visualProofs:40,priceCents:9900,priceDisplay:"$99",oneTime:!1,legacy:!0,description:"Legacy pack — preserved for refund and replay only.",stripePriceId:o.STRIPE_PRICE_TEAM||null}},s={...r,...l},m=[r.single_project,r.unlimited];function c(e){var t;return null!=(t=s[e])?t:null}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=e.find(e=>"single_project"===e.id)||null,n=e.find(e=>"unlimited"===e.id)||null,i=t&&t.priceCents&&!t.unlimited&&Number.isFinite(t.fitChecks)&&t.fitChecks?t.priceCents/100/t.fitChecks:null,a=t?function(e){let t=function(e){let t=s[e];return t&&0!==t.priceCents&&t.fitChecks&&!t.unlimited&&Number.isFinite(t.fitChecks)?t.priceCents/t.fitChecks:null}(e);return null===t?null:"$".concat((t/100).toFixed(2))}(t.id):null,o=i?Math.round(40/i):null,r=n&&i?Math.floor(n.priceCents/100/i):null,l=i?Math.max(22,Math.round(100*i/(i+40))):22;return{perCheckUsd:i,perCheckDisplay:a,mistakeDisplay:"$".concat(40),anchorRatioChecks:o,breakEven:r,wrongBarPct:100-l,rightBarPct:l}}[...m,r.project_continue].map(e=>e.id),i.gD.simple.tokenCost,i.gD.viz.tokenCost,i.gD.multi.tokenCost},91638:(e,t,n)=>{n.d(t,{eQ:()=>i,uH:()=>s});let i=Object.freeze(["wrong_dims","wrong_entity","wrong_verdict","disbelief","already_paid","unclear"]);Object.freeze(["explicit","inferred_from_text"]),Object.freeze(["accurate","inaccurate"]);let a=/\b(?:dimension|dimensions|measurement|measurements|width|height|depth|length|inches|inch|cm|centimet|millimet|mm|size|sizes)\b/,o=/\b(?:wrong|incorrect|not\s+right|isn'?t\s+right|aren'?t\s+right|not\s+correct|mistaken|off\s+by|way\s+off)\b/,r=/\b(?:what\s+i\s+gave\s+you|actual\s+measurements?|my\s+(?:actual|real)\s+(?:measurements?|dimensions)|i\s+already\s+(?:gave|told|said)|i\s+did\s+(?:give|tell))\b/,l=[{dispute_class:"already_paid",test:e=>/\b(i|we)\s+(?:have\s+)?already\s+(?:paid|purchased|bought|subscribed)\b/.test(e)||/\b(i|we)\s+(?:just\s+)?(?:paid|purchased|bought)\b[^.?!]{0,40}\b(?:for|and)\b/.test(e)||/\balready\s+paid\b/.test(e)},{dispute_class:"wrong_dims",test:e=>a.test(e)&&(o.test(e)||r.test(e))},{dispute_class:"wrong_entity",test:e=>/\bthat(?:'s| is)\s+not\s+(?:my|the|what)\b/.test(e)||/\bi\s+(?:said|asked about|meant)\b[^.?!]{0,60}\bnot\b/.test(e)||/\bwrong\s+(?:item|object|thing|space|room|door|car|vehicle|elevator)\b/.test(e)||/\b(?:you|it)\s+(?:used|picked|chose)\s+the\s+wrong\b/.test(e)},{dispute_class:"wrong_verdict",test:e=>/\bit\s+(?:does|did|will)\s+fit\b/.test(e)||/\bit\s+(?:does\s*n[o']?t|doesn'?t|won'?t|didn'?t)\s+fit\b/.test(e)||/\bthat(?:'s| is)\s+(?:wrong|incorrect|not right|not correct)\b/.test(e)||/\b(?:answer|verdict|result)\s+is\s+(?:wrong|incorrect)\b/.test(e)||/\bi\s+(?:already\s+)?(?:got|fit|moved)\s+it\s+(?:in|through|up)\b/.test(e)},{dispute_class:"disbelief",test:e=>/\bare\s+you\s+(?:sure|certain)\b/.test(e)||/\bthat\s+can'?t\s+be\s+(?:right|true)\b/.test(e)||/\b(?:doesn'?t|does\s+not)\s+seem\s+right\b/.test(e)||/\bhow\s+(?:is|can)\s+that\s+(?:be\s+)?(?:right|possible)\b/.test(e)||/\bno\s+way\b/.test(e)||/\bseriously\?/.test(e)},{dispute_class:"unclear",test:e=>/\byes\s+or\s+no\b/.test(e)||/\bis\s+that\s+a\s+(?:yes|no)\b/.test(e)||/\bso\s+(?:does|will|can)\s+it\s+fit\b.*\?/.test(e)||/\bi\s+(?:don'?t|do\s+not)\s+understand\b/.test(e)||/\bwhat\s+does\s+that\s+mean\b/.test(e)||/\byou\s+(?:didn'?t|did\s+not)\s+answer\b/.test(e)}];function s(e){let t={disputed:!1,dispute_class:null};if("string"!=typeof e)return t;let n=e.slice(0,600).toLowerCase();if(n.trim().length<3)return t;for(let e of l)if(e.test(n))return{disputed:!0,dispute_class:e.dispute_class};return t}},92559:(e,t,n)=>{n.d(t,{Fk:()=>h,L4:()=>G,Mi:()=>W,_r:()=>i._r,ie:()=>E,bF:()=>D,fH:()=>L,uH:()=>R,hs:()=>x,qd:()=>O,MK:()=>A,x2:()=>C,KZ:()=>M,CR:()=>T,FB:()=>u,LB:()=>I,Tj:()=>z,pw:()=>i.pw,_Q:()=>B,FT:()=>q,wv:()=>$,generateResidualResponse:()=>j,Iz:()=>
1o});var i=n(94059);function a(e,t,n,i,a){if("approximate_soft"!==t||n>=0||!i||i<=0||Math.abs(n)/i>((null==a?void 0:a.compressionPct)?a.compressionPct/100:.2))return"";let o=Math.abs(n)/25.4;return"However, ".concat(e," is flexible/compressible — it may fit if compressed ~").concat(o.toFixed(1)," inches.")}function o(e,t){return"approximate_soft"!==t?"":"Size recommendation assumes rigid dimensions. ".concat(e," may fit in a smaller space due to flexibility.")}var r=n(98224),l=n(17192),s=n(7360),m=n(89175),c=n(89609),d=n(81143);let h=!0;function u(e){var t;if(!e||e.tightestPoint||null==e.margin_mm)return e;let n=new Set(["width","height","depth","length"]),i=String(e.limiting_constraint||"").toLowerCase();return(!i||n.has(i))&&(e.tightestPoint={entityA:"item",entityB:"opening",axis:i||"width",clearance_mm:e.margin_mm}),e.geometryClass=e.geometryClass||"static",e.enrichedConfidence=e.enrichedConfidence||(null==(t=e.confidence)?void 0:t.level)||e.confidence||"medium",e.enrichedAssumptions=e.enrichedAssumptions||[],e}let _={"item_width::door_width":"{itemName} width passing through {spaceName} width","item_depth::door_width":"{itemName} depth passing through {spaceName} width","item_height::door_height":"{itemName} height passing through {spaceName} height","item_width::door_height":"{itemName} width passing through {spaceName} height","item_depth::door_height":"{itemName} depth passing through {spaceName} height","item_height::door_width":"{itemName} height passing through {spaceName} width","item_width::slot_width":"{itemName} width through {spaceName} opening width","item_height::slot_height":"{itemName} height through {spaceName} opening height","item_depth::slot_depth":"{itemName} depth into {spaceName} depth","item_length::container_length":"{itemName} length inside {spaceName} length","item_width::container_width":"{itemName} width inside {spaceName} width","item_height::container_height":"{itemName} height inside {spaceName} height","item_depth::container_depth":"{itemName} depth inside {spaceName} depth","item_width::elevator_door_width":"{itemName} width through elevator door width","item_depth::elevator_door_width":"{itemName} depth through elevator door width","item_height::elevator_door_height":"{itemName} height against elevator door height","item_width::cab_width":"{itemName} width inside cab width","item_depth::cab_depth":"{itemName} depth inside cab depth","item_height::cab_height":"{itemName} height inside cab height","item_length::cab_depth":"{itemName} length inside cab depth","item_length::truck_bed_length":"{itemName} length in truck bed","item_width::truck_bed_width":"{itemName} width in truck bed","item_height::truck_bed_height":"{itemName} height in cargo area","item_length::cargo_length":"{itemName} length in cargo area","item_width::cargo_width":"{itemName} width in cargo area","item_height::cargo_height":"{itemName} height in cargo area","item_cross_section::cargo_opening":"{itemName} cross-section vs cargo opening","item_width::hallway_width":"{itemName} width in hallway","item_depth::hallway_width":"{itemName} depth in hallway","item_length::hallway_width":"{itemName} length in hallway","item_sweep_radius::inner_corner":"{itemName} diagonal sweep at the inner corner of the turn","vehicle_clearance::entry_plane":"{itemName} clearance at the entry plane","item_footprint::room_walkway":"{itemName} footprint vs available walkway in {spaceName}","item_footprint::room_floor":"{itemName} footprint exceeds {spaceName} floor area","item_height::room_height":"{itemName} height vs {spaceName} ceiling height","item_height::hallway_height":"{itemName} height in hallway","item_width::corridor_width":"{itemName} width in corridor","item_height::ceiling_height":"{itemName} height vs ceiling"},g={static:{moderate:null,tight:"Two people recommended for safe handling.",precision:"Two-person carry minimum. Clear the path completely before attempting."},rotational:{moderate:"Tilt the item to the specified angle before entering the opening.",tight:"Two people needed — one to hold the tilt angle, one to guide through.",precision:"Requires precise angle control. Practice the rotation before committing to the pass."},corner:{moderate:"Navigate the corner slowly, pivoting around the inner wall.",tight:"Two people needed — one at each end to coordinate the pivot.",precision:"Extremely tight pivot. Consider padding the inner corner to prevent wall damage."}
1,motion:{moderate:"Approach at the specified angle. Maintain steady speed through the opening.",tight:"Skilled operator recommended. Precise angle control needed throughout the pass.",precision:"Expert operator required. Very tight tolerances — verify clearances on-site first."}},p={passage:{tight:["Remove the door from its hinges for extra clearance","Try a different entry point"],doesnt_fit:["Disassemble the item if possible","Check for wider doors or windows","Consider professional movers with pivot techniques"]},container:{tight:["Add minimal padding only at contact points"],doesnt_fit:["Use a larger container","Ship items separately"]},elevator:{tight:["Use the freight elevator if available"],doesnt_fit:["Disassemble the item","Use the freight elevator","Check stairwell dimensions"]},vehicle:{tight:["Secure with ratchet straps — movement tolerance is minimal"],doesnt_fit:["Fold rear seats if available","Use a larger vehicle","Split the load across two trips"]},hallway:{tight:["Remove wall-mounted fixtures along the path","Pad inner corners"],doesnt_fit:["Disassemble the item","Try an alternate route","Check window access"]},room:{tight:["Rearrange existing furniture for more clearance"],doesnt_fit:["Consider a smaller version of the item","Measure alternate placement positions"]},motion:{tight:["Clear the approach path completely","Use a spotter to guide entry angle"],doesnt_fit:["Widen the opening if possible","Disassemble and reassemble inside"]}};function f(e,t){return t?e+"\n\n"+t.trim():e}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"in",n=(0,s.x)(t),i=[],a=e.confidence||e.enrichedConfidence||"MEDIUM";if(i.push("**Calculation Summary** \xb7 ".concat(a," Confidence")),null!=e.margin_mm){let t,a=(t=Math.abs(e.margin_mm),(0,l.ix)({mm:null!=t?t:0,role:"clearance",source:"solver"},n,{context:"prose",precision:"measurement"})),o=e.margin_mm>=0?"+":"-";i.push("Margin: ".concat(o).concat(a))}e.verdict&&i.push("Verdict: ".concat(e.verdict));let o=e.assumptions||[];if(o.length>0)for(let e of(i.push(""),i.push("**Assumptions**"),o))i.push("- ".concat(e));let r=e.geometryClass||"static";return"static"!==r&&i.push("\nGeometry: ".concat(r)),i.push(""),i.push("*Measure your specific space to confirm — dimensions vary.*"),i.join("\n")}function v(e){var t,n,i;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:o="in"}=a,{verdict:r,tightestPoint:h,geometryClass:u="static",enrichedConfidence:f,enrichedAssumptions:w=[],margin_mm:v,rotationDetail:b,maneuverDetail:y}=e,T=(null==(t=e.details)?void 0:t.opening_width_mm)||(null==(n=e.details)?void 0:n.constrainingDim_mm)||null,I=null!=(i=a.marginPercent)?i:null;if(null==I&&(null==h?void 0:h.clearance_mm)!=null){let t=e._constrainingDim_mm||T;t&&t>0&&(I=(0,c.Bo)(h.clearance_mm,t))}let M=(0,m.ww)(I),S=e.dimensionSource||"",k=function(e,t,n,i,a,o,r){let c,d=arguments.length>7&&void 0!==arguments[7]&&arguments[7],h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,u=arguments.length>9&&void 0!==arguments[9]&&arguments[9],_=(0,s.x)(r),g=(0,m.Cm)(e,t,i),p=null===g?"":(c=Math.abs(g),(0,l.ix)({mm:null!=c?c:0,role:"clearance",source:"solver"},_,{context:"prose",precision:"measurement"})),f=null!=h&&h>0?(0,l.ix)({mm:h,role:"item-dimensions",source:"solver"},_,{context:"prose",precision:"measurement"}):null;return(0,m.M$)(e,{margin:p,marginPercent:n,geometryClass:o,angle:null==a?void 0:a.requiredAngle_deg,hasRotationDetail:!!a,estimatedDims:d,overhang:f,overhangNeedsFlag:u})}(r,v,I,h,b,u,o,!!S&&"user_provided"!==S&&"user"!==S,e.overhang_mm,e.needsFlag),N={...a,_marginPercent:I},x="";return x+=function(e,t,n){let{icon:i,headline:a}=t;return"**".concat(i," ").concat(a,"**")}(0,k,0),x+=function(e,t,n,i,a){let{userUnit:o="in",itemName:r="Item",spaceName:m="Space"}=a,c=(0,s.x)(o),h=(0,d.jq)(e.verdict)?"Why it fits":"Why it doesn't fit",u="\n\n[why-detail
1s]\n> ".concat(h);if(a.humanSummary&&(u+="\n\n".concat(a.humanSummary)),t){let e,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Item",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Space";if(!e)return"";let{entityA:i,entityB:a,axis:o}=e,r=_["".concat(i,"::").concat(a)];if(r)return r.replace(/{itemName}/g,t).replace(/{spaceName}/g,n);let l=e=>e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return"".concat(l(i)," vs ").concat(l(a)," (").concat(o," axis)")}(t,r,m),a=t.clearance_mm,o=null!=a?(e=Math.abs(a),(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},c,{context:"prose",precision:"measurement"})):"?",s=null!=a&&a<0?"-":"";u+="\n\nTightest point: ".concat(i),u+="\nRemaining clearance: ".concat(s).concat(o).concat(null!=n?" (".concat(n,"%)"):"")}return u+"\n[/why-details]"}(e,h,I,0,N),x+=function(e,t){var n,i,a,o,r,m;if("elevator"===(t.queryType||e.queryType))return"\n[maneuver-details]\nBefore planning delivery, measure the approach and turning space outside the elevator and confirm the door position relative to the hallway. The modeled entry and resting poses do not establish continuous movement between them.\n[/maneuver-details]";let{userUnit:c="in"}=t,h=(0,s.x)(c),u=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},h,{context:"prose",precision:"measurement"}),_=e.verdict,g=t.queryType||(null==e?void 0:e.queryType)||"passage";if((0,d.AO)(_)){let t=(null==(n=p["container_fit"===g?"container":g])?void 0:n.doesnt_fit)||p.passage.doesnt_fit,a="\n\n[maneuver-details]\n> How to make it work";for(let e of(a+="\n\nThe item exceeds the space in every orientation — standard entry won't work. Consider these alternatives:",a+="\n",t))a+="\n- ".concat(e);return(null==(i=e.needs_user_input)?void 0:i.length)>0&&(a+="\n\nFor a more complete analysis, provide: ".concat(e.needs_user_input.join(", ").toLowerCase(),".")),a+="\n[/maneuver-details]"}let f=e.maneuverDetail,w=e.geometryClass||"static",v=e.details||{},b="",y=null,T=null,I=null;if(f){let e;y=f.requiredAngle_deg,T=null!=f.approachDistance_mm?(e=f.approachDistance_mm,(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},h,{context:"prose",precision:"measurement"})):null,I=null!=f.sweepRadius_mm?u(f.sweepRadius_mm):null}if("corner"===w)b="The item must pivot around the inner corner of the turn. "+(null!=I?"The diagonal sweep radius is ".concat(I,". "):"")+"Align the item along the first corridor, then slowly rotate around the corner into the second corridor.";else if("motion"===w)b="Approach the opening at ~".concat(y||0,"\xb0. ")+(null!=T?"Minimum approach distance: ".concat(T,". "):"")+"Maintain the entry angle throughout the pass.";else if("compound_rotational"===w){let t=null==(a=e.details)?void 0:a.compoundTiltDetail;if(t){let e="difficult"===t.practicalityTier||"extreme"===t.practicalityTier;b="Tilt the item back ~".concat(t.pitch_deg,"\xb0 and angle sideways ~").concat(t.yaw_deg,"\xb0 before entering the opening. ")+"Maintain this compound angle while sliding through. Straighten once past the frame.",e&&(b+=" This maneuver likely requires coordinated handling.")}else b="Navigate through at a compound angle (tilted back and angled sideways simultaneously)."}else if("rotational"===w&&e.rotationDetail){let t=e.rotationDetail;y=y||t.requiredAngle_deg,b="Tilt the item to ~".concat(y,"\xb0 before entering the opening. ")+"Maintain this angle while sliding through. Straighten once past the frame."}else{let t=null==(o=e.checked_orientations)?void 0:o.find(e=>e.feasible),n=v.rotationNeeded;if("container"===g||"container_fit"===g){let n=(0,d.jq)(_);b=("multi_item_volume_heuristic"===e.method||Array.isArray(e.items)&&e.items.length>1)&&n?"All items fit by volume — pack them together and verify the arrangement, keeping the tightest pieces flat against the container walls.":t||n?"Place the item in the orientation with the best clearance on all sides.":"No orientation fits — the item exceeds the container in every arrangement."}else if("elevator"===g)b=n?"Orient the item so it is ".concat(n,". Slide through the elevator door, then position inside the cab."):"Slide the item through the elevator door in its narrowest orientation, then position inside the cab.";else if("vehicle"===g)b="Load the item into the cargo area in its best-fitting orientation. Secure before transport.";else if("room"===g||"room_fit"===g)b="Position the item in the room using the orientation that maximizes walkway clearance.";else if(n)b="Orient the item so it is ".concat(n,". ")+"Slide straight through the opening, keeping it level.";else if(t){let e=(null==(r=t.dimensions_mm)?void 0:r.width)?u(t.dimensions_mm.width):null,n=(null==(m=t.dimensions_mm)?void 0:m.height)?u(t.dimensions_mm.height):null;b=e&&n?"Orient the item with ".concat(e," across and ").concat(n," upright. Slide straight through the opening."):"Slide the item straight through the opening in its narrowest orientation."}else b="Slide the item straight through the opening in its narrowest orientation.";
1y=y||0}let M=["container","container_fit","room","room_fit","vehicle","multi-item"].includes(g),S="";return M||(S="\n\nRequired entry angle: ".concat(null!=y?"~".concat(y,"\xb0"):"straight (0\xb0)")+"\nMinimum approach space: ".concat(null!=T?"~".concat(T):"standard (item length)")),"\n\n[maneuver-details]\n> Best way to move it"+"\n\n".concat(b)+S+"\n[/maneuver-details]"}(e,N),x+=function(e,t,n,i){let{userUnit:a="in"}=i,o=e.geometryClass||"static",r=i._marginPercent,l=null==r&&"impossible"===t&&!(0,d.AO)(e.verdict),s=l?"Not computed":({easy:"Comfortable",moderate:"Adequate",tight:"Minimal",precision:"Near-zero",impossible:"Negative"})[t]||"Unknown",c="\n\n[difficulty-details]\n> Effort required";if(c+="\n\nSafety margin: **".concat(s,"**"),l)c+="\nOperational expectation: The clearance percentage could not be computed for this space — read the measurements below directly.";else if("impossible"===t)c+="\nOperational expectation: Item exceeds the space — no handling technique can resolve the size difference.";else{let e=function(e,t,n){var i;let a=m.be[t];if(!a)return null;let o=a.replace(/{marginPercent}/g,null!=n?n:"?"),r=null==(i=g[e])?void 0:i[t];return r?"".concat(o," ").concat(r):o}(o,t,r);c+="\nOperational expectation: ".concat(e||"Standard handling — no special equipment or technique needed.")}return c+"\n[/difficulty-details]"}(e,M,0,N),x+=function(e,t){let{userUnit:n="in"}=t,i=e.marginRange;if(!i||null==i.low_mm)return"";let a=(0,s.x)(n),o=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},a,{context:"prose",precision:"measurement"}),r=o(i.low_mm),m=o(i.high_mm),c=e.pFit,d="\n\n[confidence-interval-details]\n> Measurement uncertainty";return d+="\nMargin range: ".concat(r," to ").concat(m," (95% confidence interval)"),null!=c&&c>.05&&c<.95&&(d+="\nProbability of fitting: ~".concat(Math.round(100*c),"%")),d+="\n[/confidence-interval-details]"}(e,N),x+=function(e,t){if(!e.compressionApplied)return"";let{userUnit:n="in"}=t,i=(0,s.x)(n),a=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},i,{context:"prose",precision:"measurement"}),o=a(Math.abs(e.originalMargin_mm||0)),r=a(e.margin_mm||0),m=Math.round(e.compressionPct||0),c="\n\n[compression-note-details]\n> Compression analysis";return c+="\nItem is flexible/compressible (~".concat(m,"% compression applied)"),c+="\nWithout compression: ".concat(o," too large"),c+="\nWith compression: ".concat(r," clearance"),c+="\n[/compression-note-details]"}(e,N),x+=function(e,t){if(!e.pieceResults||0===e.pieceResults.length)return"";let{userUnit:n="in"}=t,i=(0,s.x)(n),a=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},i,{context:"prose",precision:"measurement"}),o="\n\n[disassembly-details]\n> Disassembly analysis";for(let t of e.pieceResults){let e=a(Math.abs(t.margin_mm||0)),n="DOESNT_FIT"===t.verdict?"✕":"✓",i=t.piece||"piece",r=t.count>1?" (\xd7".concat(t.count,")"):"";o+="\n".concat(n," ").concat(i).concat(r,": ").concat("DOESNT_FIT"===t.verdict?"".concat(e," too large"):"".concat(e," clearance"))}return e.disassemblyApplied&&(o+="\n\n**All pieces fit individually** — reassembly required at destination."),o+="\n[/disassembly-details]"}(e,N),x+=""}var b=n(59296),y=n(87062);function T(e){var t,n,i,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!e.verdict||(null==(t=e.solver_support)?void 0:t.support_level)===b.CZ.UNSUPPORTED)return null;let{userUnit:r="in",queryType:d="passage",itemName:h=null,spaceName:u=null}=o,_=(0,s.x)(r),g=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},_,{context:"prose",precision:"measurement"}),p=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},_,{context:"prose",precision:"measurement"}),{verdict:f,margin_mm:w,details:v,tightestPoint:T,limiting_constraint:I}=e;if("UNKNOWN"===f||"CLARIFY"===f||"INCOMPLETE"===f)return null;let M="fit"===(0,y.fF)(f),S=null!=(i=null!=(n=null==T?void 0:T.clearance_mm)?n:w)?i:0,k=(null==T?void 0:T.clearance_mm)!=null||null!=w,N=(null==v?void 0:v.opening_width_mm)||(null==v?void 0:v.constrainingDim_mm)||e._constrainingDim_mm||(k?null==T?void 0:T.entityB_mm:null)||null,x=null;(null==v?void 0:v.walkwayPercent)!=null?x=v.walkwayPercent:null!=S&&N&&N>0&&(x=(0,c.Bo)(S,N));let E=(0,m.ww)(x),D=M&&"impossible"===E?"moderate":E,F=h&&/^\d+ /i.test(h),C=h?F?"all ".concat(h.toLowerCase()):"the ".concat(h):"the item",O=h?F?"All ".concat(h.toLowerCase()):"The ".concat(h):"The item",R=u?" in the ".concat(u):"",A="UNKNOWN"===f||"CLARIFY"===f||"INCOMPLETE"===f,L=-999===w,P=null;if(A||L||!T){if(!A&&!L&&null!=w){let e=p(Math.abs(w)),t=I||"width";P=M?"".concat(O," leaves ").concat(e," clearance at the ").concat(t).concat(R,"."):"".concat(O," is ").concat(e," over at the ").concat(t).concat(R,".")}}else{let e,t=null!=T.entityA_mm?g(T.entityA_mm):null,n=null!=T.entityB_mm?(e=T.entityB_mm,(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},_,{context:"prose",precision:"measurement"})):null,i=p(Math.abs(S)),a=T.axis||I||"width";if(null!=t&&null!=n){let e=F?"":"'s";P=!M&&null!=T.entityA_mm&&null!=T.entityB_mm&&T.entityA_mm<=T.entityB_mm+1?"".concat(O).concat(e," ").concat(a," (").concat(t,") is within the ").concat(n," opening").concat(R,", but needs ").concat(i," more handling clearance to pass."):M?"".concat(O).concat(e," ").concat(a," (").concat(t,") leaves ").concat(i," clearance").concat(R," (").concat(n," opening)."):"".concat(O).concat(e," ").concat(a," (").concat(t,") exceeds").concat(R," opening (").concat(n,") by ").concat(i,".")}else null!=w&&(P=M?"".concat(O," leaves ").concat(i," clearance at the ").concat(a).concat(R,"."):"".concat(O," is ").concat(i," over at the ").concat(a).concat(R,"."))}let U=null;if("compound_tilt"===e.method&&(null==v?void 0:v.compoundTiltDetail)){let e=v.compoundTiltDetail;U="difficult"===e.practicalityTier||"extreme"===e.practicalityTier?"Tilt ".concat(C," back ~").concat(e.pitch_deg,"\xb0 and angle sideways ~").concat(e.yaw_deg,"\xb0 — requires coordinated handling."):"Tilt ".concat(C," back ~").concat(e.pitch_deg,"\xb0 and angle sideways ~").concat(e.yaw_deg,"\xb0 relative to the doorway.")}else if(e.recommendation)U=e.recommendation;else if(null==v?void 0:v.best_orientation){let e=v.best_orientation,t=e.across_hallway_mm?g(e.across_hallway_mm):null,n=e.vertical_mm?g(e.vertical_mm):null,i=e.along_hallway_mm?g(e.along_hallway_mm):null;t&&n&&i&&(U="Orient ".concat(C," ").concat(t," across, ").concat(n," upright, ").concat(i," along the path."))}else(null==v?void 0:v.best_face)?U="Orient ".concat(C," with the ").concat(v.best_face," face toward the opening."):M&&"easy"===D?U="Carry ".concat(C," through in its natural orientation — plenty of room."):M&&("tight"===D||"precision"===D)?U="Angle ".concat(C," carefully — protect edges and corners on the way through."):M&&(U="Move ".concat(C," through carefully — keep it level and centered."));let H={tightestPoint:P,bestApproach:U,effortDescription:function(e,t){let n=t||"this";return({easy:"1 person can handle ".concat(n,". Straightforward move."),moderate:"2 people recommended for ".concat(n,". Standard handling — no special equipment."),tight:"2 people required for ".concat(n,". C
1areful maneuvering — protect edges and corners."),precision:"2–3 people required for ".concat(n,". Precision handling — very little margin for error."),impossible:null})[e]||null}(D,C),effortTier:D,isFit:M,marginPercent:x},W=e.handlingFeasibility,G=W&&null!=W.peopleCount&&!(W.peopleCount<=1)?W.practicallyFeasible?"**".concat(W.peopleCount," people recommended** for safe handling."):"⚠️ ".concat(W.guidance):null;return G&&(H.peopleCountLine=G,H.peopleCount=W.peopleCount),W&&(H.practicallyFeasible=W.practicallyFeasible,W.floorLoadNote&&(H.floorLoadNote=W.floorLoadNote),null!=W.floorLoadPressure_kpa&&(H.floorLoadPressure_kpa=W.floorLoadPressure_kpa),(null==(a=W.loadCapacity)?void 0:a.note)&&(H.loadCapacityNote=W.loadCapacity.note)),H}function I(e){var t,n;if(!e)return{};let i=e._multiItemRoomResult,a=null;if((null==i||null==(t=i.perItemResults)?void 0:t.length)>1&&(a=i.itemLabel||"".concat(i.perItemResults.length," Items")),!a){let t=e.parsedPassageItem||e.parsedElevatorItem||e.parsedVehicleItem||e.parsedRoomItem||(null==(n=e.parsedItems)?void 0:n[0])||null;a=(null==t?void 0:t.name)||(null==t?void 0:t.type)||null}a||(a=e.itemLabel||e.tightestItemName||null);let o=a?a.replace(/\b\w/g,e=>e.toUpperCase()):null,r=e.parsedPassageSpace||e.parsedRoom||e.parsedElevator||e.parsedContainer||null;return{itemName:o,spaceName:(null==r?void 0:r.name)||(null==r?void 0:r.type)||e.containerType||null}}function M(e){var t,n,i,a,o,m,c,d,h,u,_,g;let p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"in",f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto",w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return[];let v=!!w.omitItems,b=(0,s.x)(p,void 0,f),y=[],T=(e,t)=>
1{if(!t)return null;let n=e=>null==e?void 0:25.4*e,i={role:e,source:"derived",widthMm:n(t.width),depthMm:n(t.depth),heightMm:n(t.height)};return null==i.widthMm&&null==i.depthMm&&null==i.heightMm?null:(0,l.Xi)(i,b,{context:"prose",precision:"measurement"})},I=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"derived"},b,{context:"prose",precision:"measurement"});for(let t of v?[]:e.items||[]){if(!t.name)continue;let e=T("item-dimensions",t.originalDimensions||t.dimensions);if(!e)continue;let n=t.dimensionSource?(0,r.eE)((0,r.wg)(t.dimensionSource)):"estimated",i=Number(t.qty),a=Number.isFinite(i)&&i>1?"".concat(i,"\xd7 ").concat(t.name):t.name;y.push({label:a,dims:e,source:n})}let M=null==(t=e.solverMetadata)?void 0:t.stairConsistency,S={risers:"risers",treads:"treads",equal_risers:"equal riser and tread counts",one_fewer:"one fewer tread than risers",single_flight:"one flight",whole_stair:"whole staircase"},k=e=>{var t,n;return null!=(n=S[null==M||null==(t=M.conventions)?void 0:t[e]])?n:"not established"};M&&y.push({label:"Stair measurement consistency",dims:M.status,source:"Arithmetic check",note:[M.scope,"Count meaning: ".concat(k("countConvention"),"; tread relationship: ").concat(k("treadConvention"),"; measurement scope: ").concat(k("measurementScope"),"."),...M.needs_user_input].join(" "),isMeasurement:!0});let N=(null==(n=e.solverMetadata)?void 0:n.accessPathMeasurements)||e.accessPathMeasurements||[];for(let t of N){let n=t.value,i=Number.isFinite(n)&&(n>=0||"signed_coordinate"===t.valueSemantics),a={user_provided:"User provided",measured:"Measured",assumed:"Assumed default",unknown:"Not measured",provided_source_unknown:"Source not recorded",room_scan:"From scan",local_db:"From database",catalog:"From catalog",derived:"Derived"};y.push({label:t.label,dims:i?"count"===t.unit?String(n):"deg"===t.unit?"".concat(n,"\xb0"):"in"===t.unit?"".concat(n," in"):I(n):"Not measured",source:a[t.source]||t.source||"Source not recorded",evaluationStatus:null!=(u=t.evaluationStatus)?u:"unknown",constraintRef:null!=(_=t.constraintRef)?_:null,evaluationLabel:{evaluated:"Evaluated",partially_evaluated:"Partially evaluated",recorded_but_not_evaluated:"Recorded, not evaluated",not_applicable:"Not applicable",unknown:"Use not established"}[null!=(g=t.evaluationStatus)?g:"unknown"],note:"front_wall_distance_mm"===t.key&&(null==(h=e.solverMetadata)||null==(d=h.accessPathCheck)?void 0:d.status)==="straight_entry_envelope"?"Straight-entry depth clears; turning into position and the exit path are not checked.":t.note,isMeasurement:!0})}let x=e.space,E=e=>"string"==typeof e&&e.length?e.charAt(0).toUpperCase()+e.slice(1):null,D=(null==(a=e.spaces)||null==(i=a[0])?void 0:i.name)||(null==(m=e.spaces)||null==(o=m[0])?void 0:o.label)||null,F=Array.isArray(e.pathSpaces)?e.pathSpaces:[],C=F.length>0;for(let e of F){let t=T("space-dimensions",null==e?void 0:e.dimensions);if(!t)continue;let n=E(e.name||e.label||e.type)||"Space",i=e.dimensionSource?(0,r.eE)((0,r.wg)(e.dimensionSource)):"estimated";y.push({label:n,dims:t,source:i})}if(!C&&(null==x||null==(c=x.vehicleSpaces)?void 0:c.length)>0){let e=x.dimensionSource?(0,r.eE)((0,r.wg)(x.dimensionSource)):"from database",t=x.vehicleSpaces,n=t[0],i=t.length-1,a=n?"".concat(n.label," (").concat(n.dims,")").concat(i>0?" + ".concat(i," other").concat(i>1?"s":""):""):"";y.push({label:x.name||"Vehicle",dims:a,source:e,isHeader:!0,subSpaces:t.length>1?t.slice(1):null})}else if(!C&&(null==x?void 0:x.dimensions)&&0===N.length){let e=T("space-dimensions",x.dimensions);if(e){let t=E(x.name||x.label||D)||E(x.type)||"Space",n=["width","depth","height"].filter(e=>x["_".concat(e,"Defaulted")]),i=["width","depth","height"].filter(e=>{var t;return(null==(t=x.dimensions)?void 0:t[e])!=null&&!n.includes(e)}),a="user_provided"===(0,r.wg)(x.dimensionSource)&&n.length>0&&i.length>0?"".concat(i.join("/")," provided; ").concat(n.join("/")," estimated"):x.dimensionSource?(0,r.eE)((0,r.wg)(x.dimensionSource)):"estimated";y.push({label:t,dims:e,source:a})}}let O=e.hybridRoom;if(null==O?void 0:O.dimensions){let e=T("space-dimensions",O.dimensions);if(e){let t=O.name||"Room",n=O.dimensionSource?(0,r.eE)((0,r.wg)(O.dimensionSource)):"estimated";y.push({label:t,dims:e,source:n})}}let R=e.containerAnalysis;(null==R?void 0:R.containerItem)&&y.some(e=>e.label.toLowerCase()===R.containerItem.toLowerCase());let A=e.carrier||e.equipment;if(A){let e=A.label||A.name||"Equipment",t=[];A.turning_radius_mm&&t.push("turning radius: ".concat(I(A.turning_radius_mm))),A.width_mm&&t.push("width: ".concat(I(A.width_mm))),A.height_mm&&t.push("height: ".concat(I(A.height_mm))),A.length_mm&&t.push("length: ".concat(I(A.length_mm)));let n=t.length>0?t.join(", "):"",i="class_template"===A.resolution?"class average":"default"===A.resolution?"default dimensions":A.dimensionSource?(0,r.eE)((0,r.wg)(A.dimensionSource)):"estimated";y.push({label:e,dims:n,source:i})}let L=e.loadCapacity;return L&&(L.itemWeightLabel&&y.push({label:"Weight",dims:L.itemWeightLabel,source:L.weightSource||"estimated"}
1),L.spaceLabel&&L.limitLabel&&y.push({label:L.spaceLabel,dims:L.limitLabel,source:L.limitSource||"standard rating"})),y}var S=n(34699),k=n(80051),N=n(96848);function x(e){var t,n,i,o,r,m,h;let u,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:g="in",queryType:p="passage",dimensionSource:b="default"}=_,y=(0,s.x)(g),T=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},y,{context:"prose",precision:"measurement"}),I=e=>(0,l.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"solver"},y,{context:"prose",precision:"measurement"}),M=e=>(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},y,{context:"prose",precision:"measurement"}),N=e.details||{},x=e.parsedItemName||"Item",E=null==(t=e.checked_orientations)?void 0:t.find(e=>e.feasible),D=(null==E||null==(n=E.dimensions_mm)?void 0:n.width)||N.smallest_item_dimension_mm,F=null==E||null==(i=E.dimensions_mm)?void 0:i.height,C=D&&F?"".concat(T(D),"\xd7").concat(T(F)):D?"".concat(T(D)):null,O="Door",R=N.opening_width_mm,A=N.opening_height_mm,
1L=R&&A?"".concat(I(R),"\xd7").concat(I(A)):R?"".concat(I(R)," wide"):null,P="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",U=(null==(o=e.tightestPoint)?void 0:o.axis)==="height"?N.opening_height_mm:N.opening_width_mm,H=function(e,t){var n;let{verdict:i,details:a,margin_mm:o}=e,r=(0,s.x)(t),m=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},r,{context:"prose",precision:"measurement"}),c=m(Math.abs(o||0)),h=null==a?void 0:a.rotationNeeded,u=(null==a?void 0:a.diagonalAngle_deg)||(null==(n=e.rotationDetail)?void 0:n.requiredAngle_deg);if((0,d.AO)(i)){let e=null==a?void 0:a.nearMiss;if(e){let t=m(e.raw_clearance_mm),n=m(e.tolerance_applied_mm);return"No orientation clears the opening with practical handling margin. When ".concat(e.rotation||"reoriented",", there is ").concat(t," of raw clearance — below the ").concat(n," practical tolerance.")}return"The item exceeds the opening in every orientation — no rotation or tilt resolves this."}return(0,d.Lk)(i,o)?h&&u?"Won't fit through the opening upright. Tilted diagonally to ~".concat(u,"\xb0, it clears the frame with ").concat(c," margin."):h?"Won't fit in its natural orientation, but fits when ".concat(h," — ").concat(c," clearance."):"FITS_VERY_TIGHT"===i?"Fits through the opening, but clearance is extremely tight at only ".concat(c,". Measure the actual opening before attempting."):"FITS_TIGHT"===i?"Fits through the opening with slim clearance of ".concat(c,". Careful maneuvering is essential."):o>=100?"Fits through the opening comfortably with ".concat(c," to spare."):"Fits through the opening with ".concat(c," clearance."):d.Ss}(e,g),W=v(e,{userUnit:g,queryType:"stairs"===p?"passage":p,itemName:x,spaceName:O,itemDims:C,spaceDims:L,itemDimSource:P,spaceDimSource:"room_scan"===b?"scanned":"default"===b?"standard dimensions":"you provided",humanSummary:H,marginPercent:U?(0,c.Bo)(e.tightestPoint.clearance_mm,U):null}),G="";if(e.tiltingIntent&&e.tiltingNotNeeded&&N.rotationNeeded){let e=N.passing_dimension_mm,t=e?T(e):null,n=t?"Diagonal tilting won't work here — but a straight pass does when ".concat(N.rotationNeeded,". The ").concat(t," dimension passes through the opening depth."):"Diagonal tilting won't work here — but a straight pass does when ".concat(N.rotationNeeded,"."),i=W.split("\n"),a=i.findIndex((e,t)=>t>0&&""!==e.trim());a>0?(i.splice(a,0,n,""),W=i.join("\n")):G+="\n\n"+n}if(e.dual_interpretation&&e.interpretation){let t="container"===e.interpretation?"fitting inside":"fitting through",n="container"===e.interpretation?"fitting through an opening":"fitting inside a container";G+="\n\nWe interpreted this as ".concat(t,". If you meant ").concat(n,", try rephrasing your query.")}if((null==(r=e.classification)?void 0:r.model)==="approximate_soft"&&"DOESNT_FIT"===e.verdict){let t=N.opening_width_mm||N.opening_height_mm||0,n=a(x,"approximate_soft",e.margin_mm,t,e);n&&(G+="\n\n"+n)}let q=e.doorLeafEnvelope;(null==q?void 0:q.status)==="supported"?G+="\n\nWith the leaf held at ".concat(q.angle_deg,"\xb0 (0\xb0 closed), the checked free strip is ").concat(M(q.free_width_mm)," before handling clearance. This opening check does not prove approach turns or the exit path."):(null==q?void 0:q.status)==="measured_clear"&&(G+="\n\nThe supplied width is the measured free opening with the door in position; no second leaf deduction is applied. Approach turns and the exit path are not proved.");let j=e.stairFlightCheck;if((null==j?void 0:j.status)==="path_proven"&&(G+="\n\nThis check covers the measured straight stair region, including entry and exit staging, at a fixed ".concat(j.path.pitch_deg,"\xb0 pitch. The item must already be in that pose; changing its pitch or orientation and moving through adjoining regions are not included.")),"stairs"===p&&N.slope_deg){let e="Stair slope: ~".concat(N.slope_deg,"\xb0 (").concat(M(N.riser_mm||178)," rise / ").concat(M(N.tread_mm||254)," run)");G+="\n\n".concat(e),(null==(m=N.landingTurnResult)?void 0:m.verdict)==="DOESNT_FIT"&&(G+="\n\nWarning: Item fits on straight stairs but **cannot navigate the landing turn**. Consider disassembly or alternative route.")}let z=N.lCorner;if(z&&null!=z.along_mm)if(z.fits){let e,t=(e=z.corner_margin_mm,(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},y,{context:"prose",precision:"measurement"}));G+=" If the hallway has an L-shaped turn (assuming equal corridor widths), the item can also navigate the corner — ".concat(t," clearance.")}else{let e=T(z.along_mm),t=T(z.bmax_mm),n=(null==(h=z.best_orientation)?void 0:h.across_hallway_mm)?T(z.best_orientation.across_hallway_mm):null,i=n?" With ".concat(n," across the corridor, the 90\xb0 sweep geometry limits the navigable length to ").concat(t,"."):" The 90\xb0 corner geometry limits the navigable length to ".concat(t,".");G+=" However, if the hallway has an L-shaped turn, the ".concat(e," length won't clear the corner.").concat(i)}G&&(W=f(W,G));let V="hallway"===p?"hallway":"passage",B=(0,k.el)(e,{userUnit:g,queryType:V,itemName:x,spaceName:O});return W+="\n\n[details-below]\n\n",W+=(u=B&&!B.includes("Proof unavailable")?[B]:[(0,S.qc)(V,e,{userUnit:g,itemName:x,dimensionSource:b}),(0,S.li)(e.checked_orientations,g,{queryType:V}
1),B].filter(Boolean)).length>0?u.join("\n\n"):w(e,g)}function E(e){var t,n,i,o;let r,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:h="cm",dimensionSource:u="default",assumptions:_=[]}=m,g=(0,s.x)(h),p=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),b=(e.parsedItems||[]).map(e=>e.name).filter(Boolean),y=b.length>0?1===b.length?b[0]:b.slice(0,-1).join(", ")+" and "+b[b.length-1]:"Item",T=(null==(t=e.details)?void 0:t.item_orientation)||(null==(n=e.details)?void 0:n.bestOrientation),I=null;if(T){let e=p(T.l),t=p(T.w),n=p(T.h);I="".concat(e,"\xd7").concat(t,"\xd7").concat(n)}let M=e.containerType||"Container",N=M.charAt(0).toUpperCase()+M.slice(1),x="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",E=null,D=e.tightestPoint;if(D){let t=D.axis;t&&(null==(o=e.details)?void 0:o.margins)&&T&&(E=("length"===t?T.l:"width"===t?T.w:T.h)+Math.abs(D.clearance_mm))}let F=function(e,t){var n;let{verdict:i,margin_mm:a,details:o,closureType:r,closureDetail:m}=e,c=(0,s.x)(t),h=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},c,{context:"prose",precision:"measurement"}),u=h(Math.abs(a||0)),_=(e.parsedItems||[]).map(e=>e.name).filter(Boolean),g=_.length>0?1===_.length?_[0]:_.slice(0,-1).join(", ")+" and "+_[_.length-1]:"The item",p=e.containerType||"container";if("FITS_WONT_CLOSE"===i){if(m){let e=h(m.excess_mm);return"".concat(g," fits inside the ").concat(p," but ").concat("clamshell"===r?"the halves won't close":"the lid won't close"," — the item extends ").concat(e," beyond the closure line.")}return"".concat(g," fits inside the ").concat(p," but the lid won't close.")}if("LIKELY_DOESNT_FIT"===i){let e=null==o?void 0:o.closest_strategy,t=e?S.IS[e]||e:null;return t?"No axis-aligned packing (".concat(t,") fits both items. Creative angled placement might work if dimensions are close."):"No standard packing arrangement fits all items. The items may fit with creative placement — try physically if dimensions are close."}if((0,d.AO)(i)){if(null==o?void 0:o.volumeExceeded)return"The combined item volume exceeds the ".concat(p,"'s capacity — no arrangement can make this work.");if(null==o?void 0:o.violations){let e=Object.entries(o.violations).filter(e=>{let[,t]=e;return t>0}).map(e=>{let[t,n]=e;return"".concat(h(n)," too ").concat("height"===t?"tall":"width"===t?"wide":"long")});if(e.length>0)return"".concat(g," is ").concat(e.join(", ")," for the ").concat(p," in every orientation.")}return"".concat(g," exceeds the ").concat(p," on ").concat(e.limiting_constraint||"one or more"," dimension(s).")}if("LIKELY_FITS"===i){let e=null==o?void 0:o.fill_percentage;return e?"All items fit individually and combined volume is ".concat(e,"% of the ").concat(p,"'s capacity. Actual fit depends on arrangement."):"Volume check suggests the items likely fit, but arrangement was not verified. Physical trial packing is recommended."}if(!(0,d.Lk)(i,a))return d.Ss;if("FITS_VERY_TIGHT"===i)return"".concat(g," fits inside the ").concat(p,", but clearance is extremely tight at only ").concat(u,". Any padding or irregular shapes could prevent fit.");if("FITS_TIGHT"===i)return"".concat(g," fits inside the ").concat(p," with slim clearance of ").concat(u,". Careful packing required.");if(((null==o?void 0:o.item_count)||(null==(n=e.checked_orientations)?void 0:n.length)||1)>1&&(null==o?void 0:o.strategy)){let e=S.IS[o.strategy]||o.strategy;return"Both items fit inside the ".concat(p," using a ").concat(e," arrangement with ").concat(u," clearance.")}return a>=50?"".concat(g," fits flat inside the ").concat(p," with clearance on all sides — ").concat(u," to spare."):"".concat(g," fits inside the ").concat(p," with ").concat(u," clearance.")}(e,h),C=v(e,{userUnit:h,queryType:"container",itemName:y,spaceName:N,itemDims:I,spaceDims:null,itemDimSource:x,spaceDimSource:"room_scan"===u?"scanned":"default"===u?"standard dimensions":"you provided",humanSummary:F,marginPercent:E?(0,c.Bo)(D.clearance_mm,E):null}),O="",R=(e.containerType||"").toLowerCase();if(/carry[\s-]?on|suitcase|luggage|cabin\s?bag/i.test(R)||/carry[\s-]?on|suitcase|luggage|cabin\s?bag/i.test(y)){let{verdict:t}=e;"FITS"===t||"FITS_TIGHT"===t||"LIKELY_FITS"===t?O+="\n\nThis means it qualifies as carry-on size.":("DOESNT_FIT"===t||"LIKELY_DOESNT_FIT"===t)&&(O+="\n\nThis means you'll likely need to check it.")}if(e.dual_interpretation&&e.interpretation){let t="container"===e.interpretation?"fitting inside":"fitting through",n="container"===e.interpretation?"fitting through an opening":"fitting inside a container";O+="\n\nWe interpreted this as ".concat(t,". If you meant ").concat(n,", try rephrasing your query.")}if((null==(i=e.classification)?void 0:i.model)==="approximate_soft"&&"DOESNT_FIT"===e.verdict){let t=E||0,n=a(y,"approximate_soft",e.margin_mm,t);n&&(O+="\n\n"+n)}O&&(C=f(C,O));let A=(0,k.el)(e,{userUnit:h,queryType:"container",itemName:y,spaceName:N});return C+="\n\n[details-below]\n\n",C+=(r=A&&!A.includes("Proof unavailable")?[A]:[(0,S.qc)("container",e,{userUnit:h,itemName:y,dimensionSource:u}),(0,S.li)(e.checked_orientations,h,{queryType:"container"}
1),A].filter(Boolean)).length>0?r.join("\n\n"):w(e,h)}function D(e){var t,n,i,a;let o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:m="in",itemName:h="Item",dimensionSource:u="default",assumptions:_=[]}=r,g=(0,s.x)(m),p=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),b=e=>(0,l.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),y=h||e.parsedItemName||"Item",T=e.bestOrientation,I=null;if(T){let e=p(T.across_door_mm),t=p(T.vertical_mm),n=p(T.along_depth_mm);I="".concat(e,"\xd7").concat(t,"\xd7").concat(n)}let M=e.doorClearance,x=e.cabClearance,E=null==x?void 0:x.effectiveDimensions,D=null;if(M&&E){let e=b(M.doorWidth_mm),t=b(M.doorHeight_mm),n=b(E.width_mm),i=b(E.depth_mm),a=b(E.height_mm);D="Door ".concat(e,"\xd7").concat(t," \xb7 Cab ").concat(n,"\xd7").concat(i,"\xd7").concat(a)}let F="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",C=(e.assumptions||[]).some(e=>/standard.*cab|standard.*elevator/i.test(e)),O=e.tightestPoint,R=e.tightestConstraint,A=null;if(O&&"door"===R)A="height"===O.axis?null==M?void 0:M.doorHeight_mm:null==M?void 0:M.doorWidth_mm;else if(O&&("cab"===R||"entry_depth"===R)&&E)A=E[((null==x?void 0:x.limitingAxis)||"width")+"_mm"];else if(O&&"rotation"===R){let t=e.movement;A=null==t||null==(a=t.witness)||null==(i=a.effectiveDimensions)?void 0:i[t.bindingAxis]}let L="".concat(function(e,t){var n;let{verdict:i,doorClearance:a,cabClearance:o,tightestConstraint:r}=e,m=(0,s.x)(t),c=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},m,{context:"prose",precision:"measurement"}),h=null==a?void 0:a.method,u=null==a?void 0:a.tiltAngle_deg,_=(0,N.u)(e);if((0,d.AO)(i)){if("door"===r){let e=c(Math.abs((null==a?void 0:a.margin_mm)||0));if((null==a?void 0:a.geometric_margin_mm)!=null&&a.geometric_margin_mm>=0){let t=c(a.geometric_margin_mm);return"The item technically clears the elevator door by ".concat(t,", but that's below the practical minimum for elevator tracks and guide rails. The effective clearance is ").concat(e," short.")}return"The item cannot fit through the elevator door in any orientation — ".concat(e," too large.")}if("cab"===r||"entry_depth"===r){let e=c(Math.abs((null==o?void 0:o.margin_mm)||0)),t=(null==o?void 0:o.limitingAxis)||"dimension";return"The item fits through the door but is too large for the cab — exceeds the ".concat(t," by ").concat(e,".")}return"rotation"===r?"The item fits through the door but cannot be rotated into its final position inside the cab.":"The item does not fit in the elevator in any orientation."}if(!(0,d.Lk)(i,_))return d.Ss;if(null==_)return"The modeled elevator checks pass; the binding clearance is unavailable.";if(null==(n=e.movement)?void 0:n.witness){let t=e.movement.witness,n=180*t.entryPose.roll_rad/Math.PI,i=180*t.entryPose.yaw_rad/Math.PI,a=180*t.finalPose.yaw_rad/Math.PI,o="Enter straight at cab yaw ".concat(i,"\xb0 and door-plane tilt ").concat(n,"\xb0, keeping that pose until fully inside at the cab center."),r=e.movement.needed?" Raise the center to ".concat(c(t.sweptDimensions.height_mm/2)," above the floor, remove the door-plane tilt, then turn at fixed center to cab yaw ").concat(a,"\xb0 and lower to rest."):" Keep the same pose at rest.";return"The modeled entry and contained movement fit with ".concat(c(_)," minimum clearance. ").concat(o).concat(r," Assumes a centered opening, level sill and empty effective cab. Outside approach and exit are unverified.")}if("FITS_TILTED"===i||"tilted"===h){let e=c(Math.abs((null==a?void 0:a.margin_mm)||0));return"The item requires tilting to ~".concat(u,"\xb0 to fit through the elevator door — ").concat(e," clearance at that angle. Once inside, it fits in the cab.")}if("diagonal"===h){let e=c(Math.abs((null==a?void 0:a.margin_mm)||0));return"The item needs diagonal entry through the elevator door — ".concat(e," clearance. It fits in the cab afterward.")}if("FITS_VERY_TIGHT"===i){let e=c(Math.abs(_));return"door"===r?"The item barely fits through the elevator door — only ".concat(e," clearance. Measure the actual door opening before attempting."):"rotation"===r?"The item enters the elevator but barely has room to rotate into position inside the cab — only ".concat(e," sweep clearance."):"The item enters the elevator but barely fits inside the cab — only ".concat(e," clearance.")}if("FITS_TIGHT"===i){let e=c(Math.abs(_));return"door"===r?"The item fits through the elevator door with slim clearance of ".concat(e,". Careful maneuvering at the door."):"The item fits through the elevator door and inside the cab with ".concat(e," clearance on the tightest axis.")}let g=c(Math.abs(_));return _>=100?"The item fits through the elevator door and inside the cab comfortably — ".concat(g," to spare."):"The item fits through the elevator door and inside the cab with ".concat(g," clearance.")}(e,m),"\n\n").concat(N.p),P=v(e,{userUnit:m,queryType:"elevator",itemName:y,spaceName:"Elevator",itemDims:I,spaceDims:D,itemDimSource:F,spaceDimSource:C?"standard dimensions":"you provided",humanSummary:L,marginPercent:A?(0,c.Bo)(O.clearance_mm,A):null}),U="";(null==(t=e.needs_user_input)?void 0:t.includes("Individual piece dimensions for more accurate assessment"))&&(U+="\n\nNote: Using worst-case full item dimensions. Provide individual piece dimensions for a more accurate assessment."),"MEDIUM"===e.confidence&&_.length>0&&(U+=" (".concat(_[0],")")),(null==(n=e.warnings)?void 0:n.length)>0&&(U+="\n\nNote: ".concat(e.warnings[0])),U&&(P=f(P,U));let H=(0,k.el)(e,{userUnit:m,queryType:"elevator",itemName:y,spaceName:"Elevator"});return P+="\n\n[details-below]\n\n",P+=(o=H&&!H.includes("Proof unavailable")?[H]:[(0,S.qc)("elevator",e,{userUnit:m,itemName:y,dimensionSource:u}),(0,S.li)(e.checked_orientations,m,{queryType:"elevator"}
1),H].filter(Boolean)).length>0?o.join("\n\n"):w(e,m)}var F=n(20713);function C(e){var t,n,i,o,m,h,u,_,g,p,w,b;let y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:T="in",vehicleData:I,itemData:M,allItemsData:S,overrideSources:k,assumptions:N=[]}=y,x=(0,s.x)(T),E=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},x,{context:"prose",precision:"measurement"}),D=e=>(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},x,{context:"prose",precision:"measurement"});if((null==S?void 0:S.length)>1&&(null==e?void 0:e.perItemResults))return null;let{verdict:C,bestSpace:O,allSpacesChecked:R,method:A,diagonalDetails:L,accessConstraint:P}=e,U=(null==M?void 0:M.name)&&"your item"!==M.name&&"Item"!==M.name?M.name:"Item",H=null==R?void 0:R.find(e=>e.spaceKey===O),W=null==H?void 0:H.orientation,G=null;W?G="".concat(E(W.l),"\xd7").concat(E(W.w),"\xd7").concat(E(W.h)):M&&(G="".concat(E(M.width_mm||0),"\xd7").concat(E(M.depth_mm||0),"\xd7").concat(E(M.height_mm||0)));let q=(null==H?void 0:H.label)||(null==O?void 0:O.replace(/_/g," "))||"Cargo area",j=q.charAt(0).toUpperCase()+q.slice(1),z=null;
1if(null==I||null==(t=I.spaces)?void 0:t[O]){let e=I.spaces[O];z="".concat(D(e.length_mm||0),"\xd7").concat(D(e.width_mm||0),"\xd7").concat(D(e.height_mm||0))}else if("truck_bed"===O&&(null==I?void 0:I.truck_bed)){let e=I.truck_bed,t=(null==H?void 0:H.tailgateState)==="tailgate_down"?e.length_tailgate_down_mm:e.length_tailgate_up_mm;z="".concat(D(t||0),"\xd7").concat(D(e.width_mm||0)," bed")}let V="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",B=null==I?void 0:I._resolver,Y=(null==B?void 0:B.source)==="exact"?"researched dimensions":(null==B?void 0:B.source)==="class_template"?"class average":"from database",K=e.tightestPoint,$=null;if(K&&W){let e=K.axis;if("width"===e&&(null==I||null==(_=I.spaces)||null==(u=_[O])?void 0:u.width_mm))$=I.spaces[O].width_mm;else if("length"===e&&(null==I||null==(p=I.spaces)||null==(g=p[O])?void 0:g.length_mm))$=I.spaces[O].length_mm;else if("height"===e&&(null==I||null==(b=I.spaces)||null==(w=b[O])?void 0:w.height_mm))$=I.spaces[O].height_mm;else if(null!=K.clearance_mm){let t="width"===e?W.w:"length"===e?W.l:"height"===e?W.h:null;t&&($=t+Math.abs(K.clearance_mm))}}let X=function(e,t){var n,i;let a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{verdict:r,margin_mm:m,method:c,bestSpace:h,allSpacesChecked:u,accessConstraint:_,diagonalDetails:g,constraintViolation:p}=e,f=(0,s.x)(t),w=(a=Math.abs(m||0),(0,l.ix)({mm:null!=a?a:0,role:"clearance",source:"solver"},f,{context:"prose",precision:"measurement"})),v=o.itemLabel||"item",b=null==u?void 0:u.find(e=>e.spaceKey===h),y=(null==b?void 0:b.label)||(null==h?void 0:h.replace(/_/g," "))||"cargo area";if((0,d.AO)(r)){let e;return e=(null==u?void 0:u.length)>0&&u.every(e=>e.blocked)?"The ".concat(v," won't fit through the cargo opening — it's too large to load in any configuration."):(null==u?void 0:u.length)>1?"The ".concat(v," won't fit in any cargo space — checked ").concat(u.length," configurations."):"The ".concat(v," won't fit in the ").concat(y,"."),(null==p?void 0:p.fitsWithout)&&(e+=" However, it fits ".concat(p.unconstrainedOrientationLabel,".")),e}if(!(0,d.Lk)(r,m))return d.Ss;if("FITS_VERY_TIGHT"===r)return"The ".concat(v," fits in the ").concat(y,", but clearance is extremely tight at only ").concat(w,". Measure your specific vehicle before attempting.");if("FITS_TIGHT"===r){if(null==_?void 0:_.isBottleneck){let e=(null==(n=_.opening)?void 0:n.replace(/_/g," "))||"opening";return"The ".concat(v," fits in the ").concat(y," but loading through the ").concat(e," is tight — only ").concat(w," clearance.")}return"The ".concat(v," fits in the ").concat(y," with slim clearance of ").concat(w,". Load carefully.")}if(null==b?void 0:b.requiresSeatFolding){let e=(0,F.JE)(v,b);if(e)return e}if("truck_bed"===h){let e=null==b?void 0:b.tailgateState,t=null==b?void 0:b.overhang_mm;if(t>0){let e=(0,l.ix)({mm:null!=t?t:0,role:"item-dimensions",source:"solver"},f,{context:"prose",precision:"measurement"});return"The ".concat(v," fits in the truck bed with ").concat(e," overhang past the tailgate.")}return"tailgate_down"===e?"The ".concat(v," fits in the truck bed with the tailgate lowered — ").concat(w," clearance."):"The ".concat(v," fits in the truck bed with the tailgate closed — ").concat(w," clearance.")}if("diagonal"===c||"diagonal_tilted"===c){let e=(null==g?void 0:g.angle_deg)||"?";return"The ".concat(v," fits in the ").concat(y," diagonally at ~").concat(e,"\xb0 — it won't fit straight.")}if("compound_tilt"===c){let t=null==(i=e.details)?void 0:i.compoundTiltDetail;if(t)return"difficult"===t.practicalityTier||"extreme"===t.practicalityTier?"The ".concat(v," fits when tilted back ~").concat(t.pitch_deg,"\xb0 and angled sideways ~").concat(t.yaw_deg,"\xb0 relative to the doorway — likely requires coordinated handling."):"The ".concat(v," fits when tilted back ~").concat(t.pitch_deg,"\xb0 and angled sideways ~").concat(t.yaw_deg,"\xb0 relative to the doorway.")}return m>=100?"The ".concat(v," fits in the ").concat(y," comfortably with ").concat(w," to spare."):"The ".concat(v," fits in the ").concat(y," with ").concat(w," clearance.")}(e,T,{itemLabel:U.toLowerCase()}),Q=v(e,{userUnit:T,queryType:"vehicle",itemName:U,spaceName:j,itemDims:G,spaceDims:z,itemDimSource:V,spaceDimSource:Y,humanSummary:X,marginPercent:$&&K?(0,c.Bo)(K.clearance_mm,$):null}),J="",Z=null==I||null==(n=I._resolver)?void 0:n.yearNote;Z&&(J+="\n\n*".concat(Z,"*"));let ee=null==I||null==(i=I._resolver)?void 0:i.bodyStyleNote;
1for(let t of(ee&&(J+="\n\n*".concat(ee,"*")),e.dataLimitations||[]))J+="\n\nNote: ".concat(t);let et=null==(o=e.assumptions)?void 0:o.find(e=>/as requested/i.test(e));if(et&&(J+="\n\n*".concat(et,"*")),"MEDIUM"===e.confidence&&N.length>0&&(J+=" (".concat(N[0],")")),(null==(m=e.warnings)?void 0:m.length)>0&&"DOESNT_FIT"!==C)for(let t of e.warnings)J+="\n\nNote: ".concat(t);if((null==(h=e.classification)?void 0:h.model)==="approximate_soft"&&"DOESNT_FIT"===C){let t=$||0,n=a(U,"approximate_soft",e.margin_mm,t);n&&(J+="\n\n"+n)}J&&(Q=f(Q,J));let en="";I&&M&&(en=(0,r.J3)(I,M,k,T));let ei=[];en&&ei.push(en);let ea=function(e,t,n){var i,a,o,r,m;let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"in",d=(0,s.x)(c),h=e=>null!=e?(0,l.ix)({mm:e,role:"clearance",source:"solver"},d,{context:"prose",precision:"measurement"}):"?",u=e.allSpacesChecked||[];if(0===u.length&&!e.margin_mm)return null;let _=["**Step-by-step proof**"],g=1;if(n){let e=n.width_mm||n.length_mm||0,t=n.depth_mm||n.length_mm||0,i=n.height_mm||0;_.push("".concat(g,". **Item dimensions**: ").concat(h(e)," \xd7 ").concat(h(t)," \xd7 ").concat(h(i)," (L\xd7W\xd7H)")),g++}for(let e of u){let n=e.label||(null==(i=e.spaceKey)?void 0:i.replace(/_/g," "))||"Space",l=null==t||null==(a=t.spaces)?void 0:a[e.spaceKey];if(_.push(""),_.push("".concat(g,". **").concat(n,"**")),g++,l)_.push("   Interior: ".concat(h(l.length_mm)," L \xd7 ").concat(h(l.width_mm)," W \xd7 ").concat(h(l.height_mm)," H"));else if("truck_bed"===e.spaceKey&&(null==t?void 0:t.truck_bed)){let e=t.truck_bed;_.push("   Bed: ".concat(h(e.length_tailgate_up_mm)," L (").concat(h(e.length_tailgate_down_mm)," tailgate down) \xd7 ").concat(h(e.width_mm)," W")),e.width_between_wheel_wells_mm&&_.push("   Between wheel wells: ".concat(h(e.width_between_wheel_wells_mm)))}if(e.blocked){_.push("   Access: ✕ blocked by ".concat((null==(o=e.blockedBy)?void 0:o.replace(/_/g," "))||"opening"," — item cannot enter this space"));continue}if(e.accessConstraint){let t=e.accessConstraint,n=t.margin_mm>=0;_.push("   Access opening (".concat(null==(r=t.opening)?void 0:r.replace(/_/g," "),"): ").concat(n?"✓":"✕"," margin ").concat(h(t.margin_mm)).concat(t.isBottleneck?" ← bottleneck":""))}if("straight"===e.method||!e.fits){let t=e.orientation;if(t&&(_.push("   Straight fit: ".concat(h(t.l)," \xd7 ").concat(h(t.w)," \xd7 ").concat(h(t.h)," orientation")),l)){let e=(l.length_mm||0)-t.l,n=(l.width_mm||0)-t.w,i=(l.height_mm||0)-t.h;_.push("   Length: ".concat(h(t.l)," ").concat(t.l<=(l.length_mm||0)?"≤":">"," ").concat(h(l.length_mm)," → ").concat(e>=0?"✓":"✕"," (").concat(h(e),")")),_.push("   Width:  ".concat(h(t.w)," ").concat(t.w<=(l.width_mm||0)?"≤":">"," ").concat(h(l.width_mm)," → ").concat(n>=0?"✓":"✕"," (").concat(h(n),")")),_.push("   Height: ".concat(h(t.h)," ").concat(t.h<=(l.height_mm||0)?"≤":">"," ").concat(h(l.height_mm)," → ").concat(i>=0?"✓":"✕"," (").concat(h(i),")"))}}if("diagonal"===e.method||"diagonal_tilted"===e.method){let t=e.diagonalDetails;if(_.push("   Method: ".concat("diagonal_tilted"===e.method?"tilted diagonal":"floor diagonal")),(null==t?void 0:t.angle_deg)!=null&&_.push("   Rotation angle: ".concat(Math.round(t.angle_deg),"\xb0")),(null==t?void 0:t.floorDiag_mm)!=null&&l){let e=Math.sqrt((l.length_mm||0)**2+(l.width_mm||0)**2);_.push("   Floor diagonal: √(".concat(h(l.length_mm),"\xb2 + ").concat(h(l.width_mm),"\xb2) = ").concat(h(Math.round(e)))),_.push("   Item diagonal footprint: ".concat(h(t.floorDiag_mm))),_.push("   ".concat(h(t.floorDiag_mm)," ≤ ").concat(h(Math.round(e))," → ").concat(t.floorDiag_mm<=e?"✓":"✕"," (clearance: ").concat(h(t.clearance_mm),")"))}}let s=e.fits?"✓ FITS":"✕ DOESN'T FIT";_.push("   Result: **".concat(s,"** (margin: ").concat(h(e.margin_mm),")"))}_.push("");let p=u.find(t=>t.spaceKey===e.bestSpace);p&&_.push("**Best space**: ".concat(p.label||(null==(m=p.spaceKey)?void 0:m.replace(/_/g," "))," via ").concat(p.method||"straight"," placement"));let f=e.tightestPoint;if(f){let e,t=(e,t)=>(e||t).replace(/_/g," ");_.push("**Limiting constraint**: ".concat((e=f.axis)&&"limiting"!==e&&"unknown"!==e?e.replace(/_/g," "):"overall size"," — ").concat(t(f.entityA,"item")," vs ").concat(t(f.entity
1B,"space")," (").concat(h(f.clearance_mm)," clearance)"))}return _.join("\n")}(e,I,M,T);return ea&&ei.push(ea),ei.push("*Measure your specific vehicle to confirm — cargo space and openings vary by model and year.*"),Q+="\n\n[details-below]\n\n"+ei.join("\n\n")}function O(e){var t,n,i,o;let r,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:h="in",assumptions:u=[],dimensionSource:_="default"}=m,g=(0,s.x)(h),p=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),b=e=>(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},g,{context:"prose",precision:"measurement"}),y=e.details||{},T=(null==(t=e.parsedRoomItem)?void 0:t.name)||"Item",I=y.itemFloor,M=null;I&&(M="".concat(p(I.width),"\xd7").concat(p(I.depth)));let N="Room",x=y.roomFloor,E=null;x&&(E="".concat(b(x.width),"\xd7").concat(b(x.depth)));let D="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",F=e.tightestPoint,C=null;if(F&&x&&I){let e=y.limitingSide;C="left"===e||"right"===e?x.width:x.depth}let O=function(e,t){var n;let{verdict:i,margin_mm:a,details:o}=e,r=(0,s.x)(t),m=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},r,{context:"prose",precision:"measurement"}),c=m(Math.abs(a||0)),h=(null==(n=e.parsedRoomItem)?void 0:n.name)||"The item",u=(null==o?void 0:o.strategyDesc)||"standard placement";if((0,d.AO)(i)){if((null==o?void 0:o.reason)==="ceiling"){let e=o.excess_mm?m(o.excess_mm):c;return"".concat(h," is ").concat(e," too tall for the room — it won't clear the ceiling.")}return(null==o?void 0:o.reason)==="floor_area"?"".concat(h," is physically larger than the room floor — it won't fit in any orientation."):"".concat(h," fits on the floor but leaves no usable walkway space — the room is too small for practical use.")}return(0,d.Lk)(i,a)?"FITS_VERY_TIGHT"===i?"".concat(h," fits but leaves only ").concat(c," minimum walkway (").concat(u,"). The room will feel cramped — consider a smaller alternative."):"FITS_TIGHT"===i?"".concat(h," fits with ").concat(c," walkway clearance (").concat(u,"). Functional but tight — you'll want to measure before committing."):a>=1219?"".concat(h," fits comfortably with ").concat(c," walkway clearance (").concat(u,"). Plenty of room to move around."):"".concat(h," fits with ").concat(c," walkway clearance (").concat(u,")."):d.Ss}(e,h),R=v(e,{userUnit:h,queryType:"room",itemName:T,spaceName:N,itemDims:M,spaceDims:E,itemDimSource:D,spaceDimSource:"room_scan"===_?"scanned":"default"===_?"standard dimensions":"you provided",humanSummary:O,marginPercent:C&&F?(0,c.Bo)(F.clearance_mm,C):null}),A="";if(y.comfortProfile){let t=y.comfortProfile,n="compact"===t.key?({FITS:"TIGHT BUT FUNCTIONAL",FITS_TIGHT:"VERY TIGHT",FITS_VERY_TIGHT:"DOESN'T FIT",DOESNT_FIT:"DOESN'T FIT"})[e.verdict]||e.verdict:null,i="compact"===t.key&&n?"Based on compact urban clearance standards. For standard residential clearances, the verdict would be ".concat(n,"."):"Based on comfort-first clearance standards. Standard residential clearances may produce a more favorable verdict.";A+="\n\n*".concat(i,"*")}if(y.assumptionDescription&&(A+="\n\n*Assumes: ".concat(y.assumptionDescription,"*")),(null==(n=y.alternatives)?void 0:n.length)>0){let e=y.alternatives[0],t={FITS:"FITS",FITS_TIGHT:"TIGHT BUT FUNCTIONAL",FITS_VERY_TIGHT:"VERY TIGHT",DOESNT_FIT:"DOESN'T FIT"}[e.verdict]||e.verdict;A+=" If ".concat(e.assumption.toLowerCase(),", the verdict improves to **").concat(t,"**.")}if("MEDIUM"===e.confidence&&u.length>0&&(A+=" (".concat(u[0],")")),"room_scan"===_&&("FITS_TIGHT"===e.verdict||"FITS_VERY_TIGHT"===e.verdict)&&(A+=' Scan measurements have \xb11-2" tolerance — consider measuring the tightest dimension manually.'),(null==(i=e.warnings)?void 0:i.length)>0&&"DOESNT_FIT"!==e.verdict)for(let t of e.warnings)A+="\n\nNote: ".concat(t);if((null==(o=e.classification)?void 0:o.model)==="approximate_soft"&&"DOESNT_FIT"===e.verdict){let t=C||0,n=a(T,"approximate_soft",e.margin_mm,t);n&&(A+="\n\n"+n)}A&&(R=f(R,A));let L=(0,k.el)(e,{userUnit:h,queryType:"room",itemName:T,spaceName:N});if(L&&!L.includes("Proof unavailable"))r=[L];
1else{let t=(0,S.qc)("room",e,{userUnit:h,itemName:T}),n=(e.checked_orientations||[]).reduce((e,t,n,i)=>{if(null==t.worstRatio)return e;let a=i[e];return(null==a?void 0:a.worstRatio)==null||t.worstRatio>a.worstRatio?n:e},0);r=[t,(0,S.li)(e.checked_orientations,h,{queryType:"room",bestIndex:n}),L].filter(Boolean)}return R+="\n\n[details-below]\n\n",R+=r.length>0?r.join("\n\n"):w(e,h)}function R(e){var t,n,i,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:r="in",assumptions:m=[],dimensionSource:h="default"}=o,u=(0,s.x)(r),_=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},u,{context:"prose",precision:"measurement"}),g=e=>(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},u,{context:"prose",precision:"measurement"}),p=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},u,{context:"prose",precision:"measurement"}),w=e.details||{},b=e.itemLabel||"Items",y=w.totalFootprint_mm2||0,T=w.roomFloor,I=null;if(y>0){let e="ft"===r?"".concat(Math.round(y/(304.8*304.8)*10)/10," sq ft"):"".concat(Math.round(y/645.16)," sq in");I="".concat(e," combined footprint")}let M=null;T&&(M="".concat(g(T.width),"\xd7").concat(g(T.depth)));let S="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",k=e.tightestPoint,N=null;k&&T&&(N=Math.min(T.width,T.depth));let x=function(e,t){var n;let{verdict:i,details:a,perItemResults:o,itemLabel:r}=e,m=(0,s.x)(t),c=null!=(n=null==a?void 0:a.walkwayPercent)?n:0,h=(null==a?void 0:a.itemCount)||(null==o?void 0:o.length)||0;if(null==a?void 0:a.ceilingFail){let e,t=a.ceilingFail.itemName,n=(e=a.ceilingFail.excess_mm,(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},m,{context:"prose",precision:"measurement"}));return"".concat(t," is ").concat(n," too tall for the room — it won't clear the ceiling.")}if(null==a?void 0:a.floorFail){let e=a.floorFail.itemName;return"".concat(e," is physically larger than the room floor — it won't fit in any orientation.")}if((0,d.AO)(i))return"All ".concat(h," pieces together leave less than 10% walkway space (").concat(c,"% remaining) — the room is too small for this furniture set.");if(!(0,d.Lk)(i))return d.Ss;if("FITS_VERY_TIGHT"===i)return"All ".concat(h," pieces fit but leave only ").concat(c,"% walkway space. The room will feel cramped — consider dropping an item.");if("FITS_TIGHT"===i)return"All ".concat(h," pieces fit with ").concat(c,"% walkway space. Functional but tight — you'll want to measure before committing.");let u=e.tightestItemName||"the largest item";return"All ".concat(h," pieces fit your room with ").concat(c,"% walkway space remaining. The ").concat(u," creates the tightest footprint.")}(e,r),E=v(e,{userUnit:r,queryType:"room",itemName:b,spaceName:"Room",itemDims:I,spaceDims:M,itemDimSource:S,spaceDimSource:"room_scan"===h?"scanned":"default"===h?"standard dimensions":"you provided",humanSummary:x,marginPercent:N&&k?(0,c.Bo)(k.clearance_mm,N):null}),D=e.perItemResults||[];if(D.length>0){let e="\n\n**Items checked**";for(let t of D){let n="FITS"===t.verdict||"FITS_TIGHT"===t.verdict?"✓":"FITS_VERY_TIGHT"===t.verdict?"⚠":"✕",i=t.dimensions_mm,a=i?" (".concat(_(i.width||i.length),"\xd7").concat(_(i.length||i.width),"\xd7").concat(_(i.height),")"):"";e+="\n".concat(n," ").concat(t.name).concat(a)}let n=null!=(t=w.walkwayPercent)?t:0;e+="\n\nCombined footprint uses ".concat(100-n,"% of floor area, leaving ").concat(n,"% for walkways."),E=f(E,e)}let F=[],C="**What we used**\n";for(let e of(T&&(C+="Room: ".concat(g(T.width),"\xd7").concat(g(T.depth)),(null==(n=w.roomFloor)?void 0:n.height)&&(C+=" \xd7 ".concat(g(w.roomFloor.height))),C+="\n"),D)){let t=e.dimensions_mm;t&&(C+="".concat(e.name,": ").concat(_(t.width||t.length),"\xd7").concat(_(t.length||t.width),"\xd7").concat(_(t.height)),e.furnitureType&&(C+=" *(from our database)*"),C+="\n")}F.push(C.trim());let O=w.roomArea_mm2||0,R="ft"===r?1/(304.8*304.8):1/645.16,A="ft"===r?"sq ft":"sq in",L=e=>{let t=e*R;return t>=100?Math.round(t):Math.round(10*t)/10},P="**All items checked**\n\n";for(let e of(P+="| | Item | Footprint | Area |\n",P+="|---|------|-----------|------|\n",D)){let t=e.dimensions_mm;if(!t)continue;let n="FITS"===e.verdict||"FITS_TIGHT"===e.verdict||"FITS_VERY_TIGHT"===e.verdict?"✓":"✕",i=_(t.width||t.length),a=_(t.length||t.width);P+="| ".concat(n," | ").concat(e.name," | ").concat(i,"\xd7").concat(a," | ").concat(L(e.footprint_mm2)," ").concat(A," |\n")}let U=O>0?Math.round(w.totalFootprint_mm2/O*100):0;F.push(P+="| | **Total** | | **".concat(L(w.totalFootprint_mm2),"** of ").concat(L(O)," ").concat(A," (").concat(U,"%) |"));let H="**Step-by-step proof**\n",W=1;if(T){let e=g(T.width),t=g(T.depth);H+="".concat(W,". Room floor area: ").concat(e," \xd7 ").concat(t," = ").concat(L(O)," ").concat(A,"\n"),W++,T.height&&(H+="".concat(W,". Room ceiling height: ").concat(g(T.height),"\n"),W++)}for(let e of(H+="\n**Per-item checks**\n",D)){let t=e.dimensions_mm;if(!t)continue;let n=_(t.width||t.length),i=_(t.length||t.width),a=t.height?_(t.height):null;if(H+="\n".concat(W,". **").concat(e.name,"** (").concat(n,"\xd7").concat(i).c
1oncat(a?"\xd7".concat(a):"",")\n"),W++,T){let e=T.width,n=T.depth,i=t.length||t.width,a=t.width||t.length,o=a<=e&&i<=n,r=i<=e&&a<=n;if(o||r){let t=o?a:i,r=o?i:a,l=e-t,s=n-r;H+="   - Wall fit: ".concat(_(t)," along ").concat(g(e)," wall → ✓ ").concat(p(l)," remaining\n"),H+="   - Depth fit: ".concat(_(r)," into ").concat(g(n)," room → ✓ ").concat(p(s)," remaining\n")}else H+="   - Floor check: ✕ too large for room in any orientation\n"}if(t.height&&(null==T?void 0:T.height)){let e=T.height-t.height;e>=0?H+="   - Ceiling: ".concat(a," < ").concat(g(T.height)," → ✓ ").concat(p(e)," headroom\n"):H+="   - Ceiling: ".concat(a," > ").concat(g(T.height)," → ✕ ").concat(p(Math.abs(e))," too tall\n")}H+="   - Footprint: ".concat(n," \xd7 ").concat(i," = ").concat(L(e.footprint_mm2)," ").concat(A,"\n")}H+="\n**Combined analysis**\n",H+="".concat(W,". Total furniture footprint: ").concat(L(w.totalFootprint_mm2)," ").concat(A," (").concat(100-(null!=(i=w.walkwayPercent)?i:0),"% of floor)\n"),W++;let G=w.remainingArea_mm2||0,q=null!=(a=w.walkwayPercent)?a:0;H+="".concat(W,". Remaining floor space: ").concat(L(G)," ").concat(A," (").concat(q,"% of room)\n"),W++,w.avgWalkway_mm>0&&(H+="".concat(W,". Estimated average walkway width: ").concat(p(w.avgWalkway_mm),"\n"),W++);let j=q>=30?"✓ Comfortable":q>=20?"⚠️ Tight but functional":q>=10?"⚠️ Very tight":"✕ Insufficient";return H+="".concat(W,". **Result: ").concat(q,"% free space ").concat(j,"**\n"),H+="   *(≥30% = comfortable \xb7 20–30% = tight \xb7 10–20% = very tight \xb7 <10% = doesn't fit)*\n",F.push(H+="\n*Dimensions are typical estimates. Measure your actual furniture for certainty.*"),E+="\n\n[details-below]\n\n"+F.join("\n\n")}function A(e){var t,n;let i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:o="in",assumptions:r=[]}=a,m=(0,s.x)(o),h=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},m,{context:"prose",precision:"measurement"}),u=e=>(0,l.ix)({mm:null!=e?e:0,role:"space-dimensions",source:"solver"},m,{context:"prose",precision:"measurement"}),_=e.details||{},g=e.parsedItemName||"Item",p=_.best_orientation,b=null;p&&(b="".concat(h(p.across_hallway_mm),"\xd7").concat(h(p.vertical_mm),"\xd7").concat(h(p.along_hallway_mm)));let y=_.corridor_width_before_mm,T=_.corridor_width_after_mm,I=_.turn_angle||90,M="".concat(I,"\xb0 Hallway Turn"),N=null;y&&T&&(N=y===T?"".concat(u(y)," wide corridor"):"".concat(u(y)," → ").concat(u(T)," corridors"));let x="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",E=(e.assumptions||[]).some(e=>/equal corridor/i.test(e)),D=e.tightestPoint,F=null;D&&("diagonal"===D.axis&&_.bmax_mm?F=_.bmax_mm:"width"===D.axis?F=Math.min(y||1/0,T||1/0):"height"===D.axis&&(F=_.ceiling_height_mm));let C=function(e,t){let n,i,{verdict:a,margin_mm:o,details:r}=e,m=(0,s.x)(t),c=(n=Math.abs(o||0),(0,l.ix)({mm:null!=n?n:0,role:"clearance",source:"solver"},m,{context:"prose",precision:"measurement"})),h=(null==r?void 0:r.binding_constraint)||e.limiting_constraint;if(null==r||r.best_orientation,(0,d.AO)(a))return"corner_sweep"===h?"The item cannot navigate the 90\xb0 corner — the diagonal sweep exceeds the available turning space by ".concat(c,"."):"corridor_width"===h?(null==r?void 0:r.short_circuit)?"The item's smallest dimension exceeds the corridor width by ".concat(c," — no orientation fits."):"No orientation fits through both the corridor and the turn — exceeds clearance by ".concat(c,"."):"ceiling_height"===h?"The item exceeds the ceiling height by ".concat(c," in all orientations."):"The item does not fit — exceeds clearance by ".concat(c," in all orientations.");if(!(0,d.Lk)(a,o))return d.Ss;let u=(null==r?void 0:r.ceiling_height_mm)&&"ceiling_height"!==h?" Clears the ".concat((i=r.ceiling_height_mm,(0,l.ix)({mm:null!=i?i:0,role:"space-dimensions",source:"solver"},m,{context:"prose",precision:"measurement"}))," ceiling."):"";return"FITS"===a?"The item navigates the hallway and 90\xb0 turn with ".concat(c," clearance.").concat(u):"FITS_TIGHT"===a?"The item fits through the hallway and 90\xb0 turn, but clearance is tight at ".concat(c,".").concat(u):"The item can navigate the turn, but clearance is minimal at ".concat(c," — verify in person.").concat(u)}(e,o),O=v(e,{userUnit:o,queryType:"hallway",itemName:g,spaceName:M,itemDims:b,spaceDims:N,itemDimSource:x,spaceDimSource:E?"assumed equal widths":"you provided",humanSummary:C,marginPercent:F&&D?(0,c.Bo)(D.clearance_mm,F):null});if("MEDIUM"===e.confidence&&((null==(t=e.assumptions)?void 0:t.length)>0||r.length>0)){let t=(null==(n=e.assumptions)?void 0:n[0])||r[0];t&&(O=f(O,"(".concat(t,")")))}let R=(0,k.el)(e,{userUnit:o,queryType:"turn",itemName:g,spaceName:M});
1return O+="\n\n[details-below]\n\n",O+=(i=R&&!R.includes("Proof unavailable")?[R]:[(0,S.qc)("turn",e,{userUnit:o}),(0,S.li)(e.checked_orientations,o,{queryType:"turn"}),R].filter(Boolean)).length>0?i.join("\n\n"):w(e,o)}function L(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{userUnit:i="in",assumptions:a=[],dimensionSource:o="default"}=n,r=(0,s.x)(i),m=e=>(0,l.ix)({mm:null!=e?e:0,role:"item-dimensions",source:"solver"},r,{context:"prose",precision:"measurement"}),c=e=>(0,l.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"solver"},r,{context:"prose",precision:"measurement"}),{verdict:h,method:u,motion_advisory:_,equipment_used:g,environment:p}=e,w=e.parsedItemName||"Item",b=null;if(e.itemDims_mm){let t=e.itemDims_mm,n=[t.width,t.depth,t.height].filter(e=>e>0);n.length>0&&(b=n.map(e=>m(e)).join("\xd7"))}let y=null;if(e.openingDims_mm){let t=e.openingDims_mm,n=[];t.width>0&&n.push("".concat(c(t.width),"W")),t.height>0&&n.push("".concat(c(t.height),"H")),n.length>0&&(y=n.join(" \xd7 "))}let T=(null==g?void 0:g.label)||"Equipment",I=(null==g?void 0:g.resolution)==="class_template"?"class average":(null==g?void 0:g.resolution)==="default"?"default dimensions":"user-prov
1ided",M=null;if(g){let e=[];g.turning_radius_mm&&e.push("turning radius: ".concat(m(g.turning_radius_mm))),g.width_mm&&e.push("width: ".concat(m(g.width_mm))),M=e.length>0?e.join(", "):null}let S="medium"===e.enrichedConfidence?"from database":"low"===e.enrichedConfidence?"estimated":"you provided",k=e.tightestPoint;(null==k?void 0:k.clearance_mm)!=null&&e.margin_mm;let N=function(e,t){let n,{verdict:i,margin_mm:a,method:o,confidence:r,motion_advisory:m,equipment_used:c}=e,h=(0,s.x)(t),u=(n=Math.abs(a||0),(0,l.ix)({mm:null!=n?n:0,role:"clearance",source:"solver"},h,{context:"prose",precision:"measurement"})),_=(null==c?void 0:c.label)||"equipment",g=null==m?void 0:m.required_angle_deg,p="corner_turn"===o||"u_turn"===o;if("UNKNOWN"===i)return"Cannot determine feasibility with the available information. Provide ".concat((null==c?void 0:c.resolution)==="default"?"specific equipment type and":""," complete dimensions for an accurate assessment.");if((0,d.AO)(i)){if(p)return"The item on the ".concat(_," cannot navigate the corner — too long by ").concat(u," for the available turning space.");let t=null==m?void 0:m.span_ratio;return t&&t>3?"The item is ".concat(t.toFixed(1),"\xd7 longer than the opening — far beyond what angled entry can solve. Disassembly or a wider opening is needed."):(e.assumptions||[]).some(e=>/body.*wider|wider.*body/i.test(e))?"The ".concat(_," itself is wider than the opening — a narrower vehicle is needed."):"Even at the optimal entry angle (~".concat(g||"?","\xb0), the item on the ").concat(_," exceeds the opening by ").concat(u,".")}if(!(0,d.Lk)(i,a))return d.Ss;if(p){var f;let t=null==(f=e._motion)?void 0:f.cornerMaxLength_mm,n=t?(0,l.ix)({mm:null!=t?t:0,role:"item-dimensions",source:"solver"},h,{context:"prose",precision:"measurement"}):null;return"FITS_TIGHT"===i?"The item on the ".concat(_," can navigate the corner, but clearance is tight at ").concat(u,".").concat(n?" Maximum navigable length: ".concat(n,"."):""):"The item on the ".concat(_," can navigate the corner with ").concat(u," clearance.").concat(n?" Maximum navigable length: ".concat(n,"."):"")}return"straight"===o?"The item fits straight through the opening on the ".concat(_," — no angling needed. ").concat(u," clearance."):"FITS_TIGHT"===i?"The item on the ".concat(_," can pass through the opening at ~").concat(g||"?","\xb0, but only ").concat(u," clearance. Skilled operator recommended."):"The item on the ".concat(_," can pass through the opening at ~").concat(g||"?","\xb0 with ").concat(u," clearance.")}(e,i),x=v(e,{userUnit:i,queryType:"motion",itemName:w,spaceName:"corner_turn"===u||"u_turn"===u?"Corner":"Door",itemDims:b,spaceDims:y,itemDimSource:S,spaceDimSource:"you provided",humanSummary:N,marginPercent:null,carrierName:T,carrierDims:M,carrierSource:I,environment:p||"warehouse"});if((null==(t=e.warnings)?void 0:t.length)>0){let t="";for(let n of e.warnings)t+="\n\n*Note: ".concat(n,"*");x=f(x,t)}return x+="\n\n[details-below]\n\n",x+=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"in",n=(0,s.x)(t),i=e=>null!=e?(0,l.ix)({mm:e,role:"clearance",source:"solver"},n,{context:"prose",precision:"measurement"}):"?",a=["**Step-by-step proof**"],o=1,r=e.details||{};if(e.itemDims_mm){let t=e.itemDims_mm,n=[t.width,t.depth,t.height].filter(e=>e>0);if(n.length>0){a.push("".concat(o,". **Item dimensions**: ").concat(n.map(e=>i(e)).join(" \xd7 ")));let e=Math.min(...n);a.push("   Smallest dimension: min(".concat(n.map(e=>i(e)).join(", "),") = ").concat(i(e))),a.push("   *(The smallest dimension determines if the item can pass through the stairway width)*"),o++}}if(e.openingDims_mm||r.stair_width_mm){var m,c;let t=r.stair_width_mm||(null==(m=e.openingDims_mm)?void 0:m.width),n=null==(c=e.openingDims_mm)?void 0:c.height;a.push("".concat(o,". **Stair dimensions**")),t&&a.push("   Total stair width: ".concat(i(t))),n&&a.push("   Ceiling height: ".concat(i(n))),o++}if(r.stair_width_mm||r.usable_width_mm){let t=r.stair_width_mm,n=r.usable_width_mm,l=e.tolerance_mm||0;a.push("".concat(o,". **Effective width calculation**")),t&&(a.push("   Stair width:           ".concat(i(t))),l>0&&a.push("   − Handling tolerance:  ".concat(i(l))),a.push("   − Handrail deduction:  ".concat(i(t&&n?t-l-n:150))),a.push("   ──────────────────────────────"),n&&a.push("   = Usable width:        ".concat(i(n)))),o++}let d=r.smallest_item_dimension_mm,h=r.usable_width_mm;if(null!=d&&null!=h){let e=d<=h,t=h-d;a.push("".concat(o,". **Width check**: ").concat(i(d)," item ").concat(e?"≤":">"," ").concat(i(h)," usable → ").concat(e?"✓":"✕")),a.push("   Margin: ".concat(i(h)," − ").concat(i(d)," = ").concat(t>=0?"+":"").concat(i(t))),o++}if(e.equipment_used){let t=e.equipment_used;a.push(""),a.push("".concat(o,". **Equipment**: ").concat(t.label||"Standard")),t.turning_radius_mm&&a.push("   Turning radius: ".concat(i(t.turning_radius_mm))),t.width_mm&&a.push("   Equipment width: ".concat(i(t.width_mm))),o++}if(e.maneuverDetail){let t=e.maneuverDetail;a.push(""),a.push("".concat(o,". **Maneuver analysis**")),null!=t.requiredAngle_deg&&a.push("   Required angle: ".concat(Math.round(t.requiredAngle_deg),"\xb0")),null!=t.approachDistance_mm&&a.push("   Approach distance: ".concat(i(t.approachDistance_mm))),o++}let u=e.assumptions||[];if(u.length>0)for(let e of(a.push(""),a.push("**Assumptions**"),u))a.push("- ".concat(e));a.push("");let _=e.margin_mm;return a.push("**Result**: ".concat(e.verdict," (margin: ").concat(_>=0?"+":"").concat(i(_),")")),e.difficulty&&a.push("Difficulty: ".concat(e.difficulty)),a.push(""),a.push("*Measure your specific stairway to confirm — dimensions vary by building.*"),a.join("\n")}(e,i)}var P=n(75198),U=n(68854),H=n(49931);function W(e,t,n){let i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"in",o=(0,s.x)(a),r=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},o,{context:"prose",precision:"measurement"}),m=e=>(0,l.ix)({mm:null!=e?e:0,role:"opening-dimensions",source:"derived"},o,{context:"prose",precision:"measurement"}),c={DOESNT_FIT:0,FITS_WONT_CLOSE:1,FITS_TIGHT:2,FITS_VERY_TIGHT:2,FITS:3},d=[],h=[],u=[],_=[],g="FITS";for(let n=0;n<t.length;n++){var p,f,w;let i=e[n],a=t[n];if(!i||!a)continue;if("UNKNOWN"===i.verdict||!(null==(p=a.dimensions)?void 0:p.width)){_.push(a.name);continue}let o="DOESNT_FIT"!==i.verdict,l=r(Math.abs(i.margin_mm)),s="height"===i.limiting_constraint?"tall":"wide",m=o?"".concat(l," to spare"):"".concat(l," too ").concat(s),v={name:a.name,verdict:i.verdict,margin_mm:i.margin_mm,margin:(0,H.lk)(i.margin_mm),dimensions:a.dimensions,note:m,item_class:a.item_class};o?d.push(v):h.push(v),u.push({name:a.name,fits:o,dimensions:a.dimensions,margin_mm:i.margin_mm,note:m,limitingConstraint:i.limiting_constraint}),(null!=(f=c[i.verdict])?f:3)<(null!=(w=c[g])?w:3)&&(g=i.verdict)}u.sort((e,t)=>
1e.fits===t.fits?0:e.fits?-1:1);let v=0===h.length,b=0===d.length,y=d.length+h.length;i=v?"All ".concat(y," items fit through the doorway"):b?"None of your ".concat(y," items fit through the doorway"):"".concat(d.length," of ").concat(y," items fit through the doorway");let T=m(n.width_mm),I=m(n.height_mm),M=n._userProvided?"Checked against your ".concat(T,"\xd7").concat(I," doorway"):"Checked against a standard ".concat(T,"\xd7").concat(I," doorway"),S=function(e,t,n,i,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"in",r="cm"===o?"cm":'"',m=(0,s.x)(o),c=e=>null==e?"?":(0,l.ix)({mm:e,role:"clearance",source:"solver"},m,{context:"prose",precision:"measurement"}),d=e=>null==e?"?":(0,l.ix)({mm:e,role:"opening-dimensions",source:"derived"},m,{context:"prose",precision:"measurement"}),h=e=>null==e?"?":(0,l.ix)({mm:e,role:"item-dimensions",source:"derived"},m,{context:"prose",precision:"measurement"}),u=(0,l.K4)(n.width_mm,"cm"===o?"cm":"in"),_=[],g=n.width_mm,p=n.height_mm,f=n._userProvided?"you provided":"standard US interior door",w=["**What we used**","Doorway: ".concat(d(g)," wide \xd7 ").concat(d(p)," tall *(").concat(f,")*")];for(let e of t){let t=e.dimensions;if(!t)continue;let n=e.dimensionSource||e.dimSource||"estimated";w.push("".concat(e.name,": ").concat(t.width,"\xd7").concat(t.depth,"\xd7").concat(t.height).concat(r," *(").concat(n,")*"))}_.push(w.join("\n"));let v=["**Step-by-step proof**"],b=1;v.push("".concat(b,". **Doorway constraint**: width = ").concat(d(g),", height = ").concat(d(p))),v.push("   An item fits if there exists at least one orientation where:"),v.push("   item_width ≤ ".concat(d(g)," AND item_height ≤ ").concat(d(p))),b++;for(let n=0;n<t.length;n++){let i=t[n],a=e[n];if(!a||!(null==i?void 0:i.dimensions))continue;let o=i.dimensions;[o.width,o.depth,o.height].filter(e=>null!=e),v.push(""),v.push("".concat(b,". **").concat(i.name,"** (").concat(o.width,"\xd7").concat(o.depth,"\xd7").concat(o.height).concat(r,")")),b++;let l=a.checked_orientations||[];if(l.length>0){var y,T,I,M,S,k,N,x,E;v.push(""),v.push("   | # | Orientation | Across door | Vertical | Width clear | Height clear | Result |"),v.push("   |---|-------------|-------------|----------|-------------|--------------|--------|");let e=-1,t=-1/0;for(let n=0;n<l.length;n++){let i=l[n],a=i.dimensions_mm||{},o=a.width,r=a.height,s=i.width_clearance_mm,m=i.height_clearance_mm,d=null==m||m>=0,u=null!=s&&s>=0&&d,_=Math.min(null!=s?s:1/0,null!=m?m:1/0);u&&_>t&&(t=_,e=n);let g=i.face||i.orientation||"Orientation ".concat(n+1),p="diagonal"===i.method?" @".concat(Math.round(i.angle_deg||0),"\xb0"):"",f=null!=s?c(s):"n/a",w=null!=m?c(m):"n/a",b=u?"✓ fits":i.rejection_reason||"✕ fail";v.push("   | ".concat(n+1," | ").concat(g).concat(p," | ").concat(h(o)," | ").concat(h(r)," | ").concat(f," | ").concat(w," | ").concat(b," |"))}if(e>=0){let t=l[e],n=null==(y=t.dimensions_mm)?void 0:y.width,i=null==(T=t.dimensions_mm)?void 0:T.height;v.push(""),v.push("   **Best orientation**: ".concat(t.face||t.orientation," — ").concat(h(n)," across \xd7 ").concat(h(i)," tall")),v.push("   Width check:  ".concat(h(n)," ≤ ").concat(d(g)," → ").concat(t.width_clearance_mm>=0?"✓":"✕"," (clearance: ").concat(c(t.width_clearance_mm),")")),null!=t.height_clearance_mm&&v.push("   Height check: ".concat(h(i)," ≤ ").concat(d(p)," → ").concat(t.height_clearance_mm>=0?"✓":"✕"," (clearance: ").concat(c(t.height_clearance_mm),")")),"diagonal"===t.method&&v.push("   Method: diagonal rotation at ~".concat(Math.round(t.angle_deg||0),"\xb0"))}else{let e=l.reduce((e,t)=>{var n,i;let a=Math.min(null!=(n=t.width_clearance_mm)?n:-1/0,null!=(i=t.height_clearance_mm)?i:-1/0);return!e||a>e.worst?{o:t,worst:a}:e},null);if(null==e?void 0:e.o){let t=e.o,n=null==(I=t.dimensions_mm)?void 0:I.width,i=null==(M=t.dimensions_mm)?void 0:M.height;v.push(""),v.push("   **Closest attempt**: ".concat(t.face||t.orientation," — ").concat(h(n)," across \xd7 ").concat(h(i)," tall")),v.push("   Width check:  ".concat(h(n)," ").concat(n<=g?"≤":">"," ").concat(d(g)," → ").concat(t.width_clearance_mm>
1=0?"✓":"✕"," (").concat(c(t.width_clearance_mm)," ").concat(t.width_clearance_mm>=0?"clearance":"too wide",")")),null!=t.height_clearance_mm&&v.push("   Height check: ".concat(h(i)," ").concat(i<=p?"≤":">"," ").concat(d(p)," → ").concat(t.height_clearance_mm>=0?"✓":"✕"," (").concat(c(t.height_clearance_mm)," ").concat(t.height_clearance_mm>=0?"clearance":"too tall",")"))}}let n=l.filter(e=>"diagonal"===e.method);if(n.length>0)for(let e of(v.push(""),v.push("   *Diagonal rotation analysis:*"),n)){let t=null==(S=e.original_dims_mm)?void 0:S.width,n=null==(k=e.original_dims_mm)?void 0:k.height,i=e.angle_deg;null!=t&&null!=n&&null!=i&&(v.push("   - Face ".concat(e.face||"?",": original ").concat(h(t),"\xd7").concat(h(n),", rotated ").concat(Math.round(i),"\xb0 → effective ").concat(h(null==(N=e.dimensions_mm)?void 0:N.width),"\xd7").concat(h(null==(x=e.dimensions_mm)?void 0:x.height))),v.push("     Rotation formula: effective_width = W\xb7cos(θ) + H\xb7sin(θ)"),v.push("     = ".concat(h(t),"\xb7cos(").concat(Math.round(i),"\xb0) + ").concat(h(n),"\xb7sin(").concat(Math.round(i),"\xb0) = ").concat(h(null==(E=e.dimensions_mm)?void 0:E.width))))}}else v.push("   Dimensions: ".concat(o.width,"\xd7").concat(o.depth,"\xd7").concat(o.height).concat(r)),v.push("   Smallest face: min(W,D) = min(".concat(o.width,", ").concat(o.depth,") = ").concat(Math.min(o.width,o.depth)).concat(r)),v.push("   ".concat(Math.min(o.width,o.depth)).concat(r," ").concat(Math.min(o.width,o.depth)<=u?"≤":">"," ").concat(d(g)," door width → ").concat(Math.min(o.width,o.depth)<=u?"✓":"✕"));let s="DOESNT_FIT"===a.verdict?"✕ DOESN'T FIT":"✓ ".concat(a.verdict),m=null!=a.margin_mm?" (margin: ".concat(c(a.margin_mm),")"):"";v.push(""),v.push("   **Verdict: ".concat(s,"**").concat(m))}_.push(v.join("\n"));let{fitsItems:D,doesntFitItems:F,allFit:C,noneFit:O}=a,R=["**Summary**"],A=D.length+F.length;if(C)R.push("All ".concat(A," items can pass through the ").concat(d(g),"\xd7").concat(d(p)," doorway."));else if(O)R.push("None of the ".concat(A," items can pass through the ").concat(d(g),"\xd7").concat(d(p)," doorway."));else{for(let e of(R.push("".concat(D.length," of ").concat(A," items fit through the ").concat(d(g),"\xd7").concat(d(p)," doorway:")),D))R.push("  ✓ ".concat(e.name," — ").concat(e.note));for(let e of F)R.push("  ✕ ".concat(e.name," — ").concat(e.note))}return R.push(""),R.push("*Dimensions are typical estimates. Measure your actual items and doorway for certainty.*"),_.push(R.join("\n")),_.join("\n\n")}(e,t,n,u,{fitsItems:d,doesntFitItems:h,allFit:v,noneFit:b},a);return{verdict:g,headline:i,batchSummary:{fitsItems:d,doesntFitItems:h,allFit:v,noneFit:b},calculationRows:u,assumptionNote:M,proofText:S}}function G(e){let{fitsItems:t=[],doesntFitItems:n=[],allFit:i,noneFit:a}=e||{},o=[],r=e=>0===e.length?"":1===e.length?e[0]:2===e.length?"".concat(e[0]," and ").concat(e[1]):"".concat(e.slice(0,-1).join(", "),", and ").concat(e[e.length-1]),l=n.length>0&&n.every(e=>"furniture"===e.item_class),s=(0,P.UM)(l?"furniture":"unknown");if(i){let e=r(t.map(e=>e.name));o.push("All your items — ".concat(e," — will fit through the doorway."));let n=t.reduce((e,t)=>!e||Math.abs(t.margin_mm)<Math.abs(e.margin_mm)?t:e,null);n&&o.push("The tightest fit is the ".concat(n.name," with ").concat(n.note,"."))}else if(a){let e=r(n.map(e=>"".concat(e.name," (").concat(e.note,")")));o.push("None of your items will fit through the doorway: ".concat(e,".")),o.push("Double-check your measurements first — if they hold, ".concat(s," are your quickest fixes."))}else{let e=r(t.map(e=>"".concat(e.name," (").concat(e.note,")"))),i=r(n.map(e=>"the ".concat(e.name," (").concat(e.note,")")));o.push("Your ".concat(e," will fit through the doorway, but ").concat(i," won't."));let a=1===n.length?"item that doesn't fit":"items that don't fit";o.push("For the ".concat(a,", double-check your measurements — if they hold, ").concat(s," are your quickest fixes."))}return o.join(" ")}function q(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{blocker:i,pathResults:a=[],containerResult:o,tightestPathPoint:r,unconstrainedCount:m}=e,c=e.verdict,d=n.userUnit||"in",h=(0,s.x)(d);if("path"===i){let e,n=r||a[0],i=(null==n?void 0:n.space)||"the passage",o=Number.isFinite(null==n?void 0:n.margin_mm)&&n.margin_mm<0?" — over by ".concat((e=Math.abs(n.margin_mm),(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},h,{context:"prose",precision:"measurement"}))):"";t="**✕ Doesn't fit** — the item can't get through the ".concat(i).c
1oncat(o,".")}else if("container"===i)t="**✕ Doesn't fit** — the item can get through, but won't fit in the space.",r&&(t+="\n\nPath: Fits through ".concat(r.space," (").concat(Math.round(r.margin_mm),"mm to spare)."));else if(null!=m&&(null==o?void 0:o.recommendedCount)!=null){let e=o.recommendedCount;t="**✓ ~".concat(e," fit** (path-constrained)"),m>e&&(t+="\n\nIf the door weren't a factor, you could fit ".concat(m,".")),r&&(t+="\n\nTightest path point: ".concat(r.space," (").concat(Math.round(r.margin_mm),"mm margin)."))}else if("FITS"===c||"FITS_TIGHT"===c||"LIKELY_FITS"===c)t="**".concat("FITS"===c?"✓":"~"," ").concat("FITS"===c?"Fits":"Tight fit","** — the item can get through and fits in the space."),r&&(t+="\n\nTightest point: ".concat(r.space," (").concat(Math.round(r.margin_mm),"mm margin).")),Array.isArray(a)&&a.length>=2&&!0!==e.continuous_path_proven&&(t+="\n\nEach opening and turn was checked separately. This does not prove one continuous carry path from start to finish — check the transitions between them before moving.");else if("DOESNT_FIT"===c||"LIKELY_DOESNT_FIT"===c){var u,_;let e=(null==r?void 0:r.space)||(null==a||null==(u=a[0])?void 0:u._spaceName)||(null==a||null==(_=a[0])?void 0:_._spaceType)||"the path";t="**✕ Doesn't fit** — the item won't make it through ".concat(e,". Provide actual measurements for a more precise answer.")}else t="Verdict: ".concat(c);let g=function(e,t){try{let n=(0,k.el)(e,{userUnit:t,queryType:"passage"});if(n&&!n.includes("Proof unavailable"))return n}catch(e){}let n=(0,s.x)(t),i=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},n,{context:"prose",precision:"measurement"}),a=["**Calculation Summary**"],o=e.tightestPathPoint;if(null==o?void 0:o.space){let e=Number.isFinite(o.margin_mm)?" — ".concat(i(Math.abs(o.margin_mm))," ").concat(o.margin_mm<0?"over":"clearance"):"";a.push("Tightest point: ".concat(o.space).concat(e))}else Number.isFinite(e.margin_mm)&&a.push("Margin: ".concat(i(Math.abs(e.margin_mm))," ").concat(e.margin_mm<0?"over":"clearance"));let r=(0,U.R)(e.assumptions||[],t);return r.length>0&&(a.push(""),a.push("**Assumptions**"),r.forEach(e=>a.push("- ".concat(e)))),a.length>1?a.join("\n"):null}(e,d);return g&&(t+="\n\n[details-below]\n\n".concat(g)),{content:t,verdict:c,_templateGenerated:!0}}function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{userUnit:n="in"}=t,i=(0,s.x)(n),a=e=>(0,l.ix)({mm:null!=e?e:0,role:"clearance",source:"solver"},i,{context:"prose",precision:"measurement"}),{verdict:o,residual:r,suggestions:m,softDisclaimer:c,residualDims:d}=e,h="";if("FULL"===o||r&&r.isEmpty)h="The space is effectively full. You'd need to rearrange or remove something to fit more.";else if("NEGLIGIBLE"===o||r&&r.isNegligible){if(h="Not much room left — maybe small boxes or bags, but nothing furniture-sized.",d){let e=[d.length_in,d.width_in].filter(e=>null!=e).map(e=>"".concat(e,'"'));d.height_in&&e.push("".concat(d.height_in,'"')),e.length>0&&(h+="\n\nRemaining space: roughly ".concat(e.join(" \xd7 "),"."))}}else if("HAS_SPACE"===o){if(d){let e=[d.length_in,d.width_in].filter(e=>null!=e).map(e=>"".concat(e,'"'));d.height_in&&e.push("".concat(d.height_in,'"')),h="**You have roughly ".concat(e.join(" \xd7 ")," of space remaining.**")}else h="**There's space remaining.**";if((null==r?void 0:r.utilizationPercent)>0&&(h+="\n\n~".concat(r.utilizationPercent,"% of the space is used.")),(null==m?void 0:m.length)>0)for(let e of(h+="\n\n**What else could fit:**",m)){let t=null!=e.margin_mm?" — fits with ".concat(a(e.margin_mm)," to spare"):"";h+="\n- ".concat(e.name," (").concat(e.dims_display,")").concat(t)}}else h="Unable to determine remaining space from the previous result.";return c&&(h+="\n\n*".concat(c,"*")),{content:h,verdict:o,_templateGenerated:!0}}function z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{userUnit:n="in"}=t,{feasible:i,placements:a=[],utilization:o,walkingPath:r,warnings:l=[],space:s}=e,m="";if(i&&a.length>0){let e=s?function(e,t){if(!e.width_mm||!e.depth_mm)return"";let n=V(e.width_mm,t),i=V(e.depth_mm,t);return"".concat(n," \xd7 ").concat(i," room")}(s,n):"";if(e?m+="**Layout for your ".concat(e,":**\n\n"):m+="**Suggested layout:**\n\n",a.forEach((e,t)=>{let i=function(e,t){let n=V(e.w,t),i=V(e.d,t);return"(".concat(n," \xd7 ").concat(i,")")}(e.orientation,n);m+="".concat(t+1,". **").concat(e.item,"** ").concat(i," — ").concat(e.description,"\n");let a=[];e.clearance.front>0&&a.push("".concat(V(e.clearance.front,n)," clearance in front")),e.clearance.left>0&&a.push("".concat(V(e.clearance.left,n)," from left wall")),e.clearance.right>0&&a.push("".concat(V(e.clearance.right,n)," from right wall")),a.length>0&&(m+="   └ ".concat(a.join(", "),"\n")),m+="\n"}),r&&(m+="Walking path: clear path maintained throughout.\n"),null!=o){let e=Math.round(100*o);m+="Floor usage: ".concat(e,"% — ").concat(e<40?"room will feel spacious":e<60?"room will feel open":e<80?"room will feel furnished":"room will feel full","\n")}m+="\n*Actual positioning may vary based on outlets, windows, and doors.*"}else m="These items won't fit comfortably in the space.\n\n",l.length>0&&(m+="The issue: ".concat(l[0],"\n"));return{content:m,verdict:i?"FITS":"DOESNT_FIT",_templateGenerated:!0}}function V(e,t){return"cm"===t||"m"===t?"".concat(Math.round(e/10),"cm"):"".concat(Math.round(e/25.4),'"')}function B(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{userUnit:i="in"}=n,{scenarioResults:a,winner:o,allFit:r,allFail:l,tooMany:s,items:m}=e,c=(null==m||null==(t=m[0])?void 0:t.name)||"your item";if(s)return{content:"That's a lot of options — can you narrow it to your top 2-3? I'll compare those in detail."};if(!a||0===a.length)return{content:"No scenarios to compare."};let d=[],h=a.map(e=>e.scenarioName).join(" vs ");if(d.push("**Comparing: ".concat(h,"** for ").concat(c,"\n")),a.length<=2?d.push(function(e,t){let n=[],[i,a]=e,o=i.scenarioName,r=a.scenarioName;return n.push("| | ".concat(o," | ").concat(r," |")),n.push("|---|---|---|"),n.push("| Verdict | ".concat(Y(i)," | ").concat(Y(a)," |")),n.push("| Clearance | ".concat(K(i.margin_mm,t)," | ").concat(K(a.margin_mm,t)," |")),(i.tightestPoint||a.tightestPoint)&&n.push("| Tightest point | ".concat(i.tightestPoint||"—"," | ").concat(a.tightestPoint||"—"," |")),n.join("\n")}(a,i)):d.push(function(e,t){let n=[],i=e.map(e=>e.scenarioName);n.push("| | ".concat(i.join(" | ")," |")),n.push("|---".concat(i.map(()=>"|---").join(""),"|"));let a=e.map(e=>Y(e));n.push("| Verdict | ".concat(a.join(" | ")," |"));let o=e.map(e=>K(e.margin_mm,t));return n.push("| Clearance | ".concat(o.join(" | ")," |")),n.join("\n")}(a,i)),d.push(""),l)for(let e of(d.push("**Neither option works** for this ".concat(c,".")),a)){let t=K(e.margin_mm,i);d.push("- ".concat(e.scenarioName,": ").concat(t))}else if(o){let e=a[o.scenarioIndex];if("only_fit"===o.reason)d.push("**Recommendation:** ".concat(e.scenarioName," is the only option that works."));else{let t=K(e.margin_mm,i);d.push("**Recommendation:** ".concat(e.scenarioName," is the better choice — ").concat(t," to spare."))}}else r&&d.push("**Both options work.** Choose based on convenience — the difference is small.");return{content:d.join("\n")}}function Y(e){return e.isFit?"TIGHT_FIT"===e.verdict?"TIGHT FIT":"FITS":"DOES NOT FIT"}function K(e,t){if(null==e)return"—";let n=Math.abs(e),i="cm"===t||"m"===t?"".concat(Math.round(n/10),"cm"):"".concat((n/25.4).toFixed(1),'"');return e>=0?"+".concat(i):"-".concat(i," (too ").concat(e<-25.4?"large":"tight",")")}function $(e){var t,n,i;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1],!e||e.redirect)return null;let{strategies:a,noFeasibleStrategy:o,recommendation:r,warnings:l,space:s}=e;if(o||!a||0===a.length){let e=(null==l?void 0:l.length)>0?l[0]:"Items do not fit in the available space";return{content:"These items won't fit in the space.\n\n".concat(e)}}let m=[];
1if(1===a.length){let e=a[0];for(let t of(m.push("There's really only one way this works:\n"),e.placements))m.push("- **".concat(t.item,"** — ").concat(t.description));return m.push("\nFloor usage: ".concat(Math.round(100*e.utilization),"%")),(null==r?void 0:r.text)&&m.push("\n".concat(r.text)),{content:m.join("\n")}}let c=s?"".concat(Math.round(s.width_mm/25.4),'" \xd7 ').concat(Math.round(s.depth_mm/25.4),'"'):"",d=(null==(n=a[0])||null==(t=n.placements)?void 0:t.length)||0;m.push("**".concat(a.length," ways to arrange your ").concat(d," items").concat(c?" in the ".concat(c," space"):"",":**\n"));for(let e=0;e<a.length;e++){let t=a[e],n="ABCDEFGH"[e]||"".concat(e+1);m.push("**Option ".concat(n,": ").concat(t.label,"**")),(null==(i=t.loadingOrder)?void 0:i.length)>0&&m.push("  Load order: ".concat(t.loadingOrder.join(" → "))),m.push("  Space used: ".concat(Math.round(100*t.utilization),"%")),t.tradeoff&&m.push("  Tradeoff: ".concat(t.tradeoff)),m.push("")}return(null==r?void 0:r.text)&&m.push("**Recommendation:** ".concat(r.text)),{content:m.join("\n")}}},94059:(e,t,n)=>{n.d(t,{_r:()=>a,pw:()=>o}),n(17192),n(7360);var i=n(550);function a(e){var t,n,a,o,r;let l,s;if(!e)return null;let{verdict:m,confidence:c,recommendedCount:d,practicalCount:h,maxCount:u,fuzzyRange:_,softItemDisclaimer:g,assumptions:p=[],item:f,containerType:w,classification:v}=e,b="FITS"===m&&d>=1,y=(null==f?void 0:f.name)||"items",T=d>1||(null==_?void 0:_.high)>1?(0,i.j)(y):y,I=(null==v?void 0:v.model)==="approximate_soft",M="HIGH"!==c?"~":"";b?I&&_?(l="Roughly ".concat(_.low,"–").concat(_.high," ").concat(T," fit"),s="Depends on how tightly you pack"):d===h&&h===u?(l="".concat(M).concat(d," ").concat(T," fit"),s=p[0]||null):(l="".concat(M).concat(d," ").concat(T," fit"),s=p[0]?"Based on ".concat(p[0].toLowerCase()):null):(l="No ".concat(T," fit"),s="The ".concat(T," is larger than the ").concat(w||"space"));let S=null!=(a=null==(t=e.remaining)?void 0:t.utilizationPercent)?a:0,k=b?"".concat(M).concat(S,"% of ").concat("room"===w?"floor area":"space"," used"):null,N=null!=(r=null!=(o=null==(n=e.packing)?void 0:n.stackLayers)?o:e.stackLayers)?r:1,x=N>1&&d>0?Math.round(d/N):null;return{isFit:b,capacityHeadline:l,capacitySubline:s,utilizationNote:k,stackingNote:null!=x?"".concat(M).concat(x," on floor \xb7 ").concat(N," layers stacked"):null}}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;let{userUnit:n="in"}=t,i=a(e);if(!i)return null;let{verdict:o,confidence:r}=e,l="";return i.isFit?l+="**".concat(i.capacityHeadline.toUpperCase(),"** ✓"):l+="**".concat(i.capacityHeadline.toUpperCase(),"** ✕"),i.capacitySubline&&(l+="\n\n".concat(i.capacitySubline)),e._templateGenerated=!0,l}},96744:(e,t,n)=>{n.d(t,{$M:()=>h,A0:()=>v,H9:()=>b,Nu:()=>T,P7:()=>u,We:()=>p,Zg:()=>y,mH:()=>f,sC:()=>c,yz:()=>w});var i=n(98934);let a=Object.freeze(["paywall","clarify","error","no_fit_check_id","timeout","superseded"]),o=null,r=null,l=new Set,s=new Set;function m(){if(null!=r){try{clearTimeout(r)}catch(e){}r=null}}function c(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o)return!1;let r=o;o=null,m();let l=a.includes(e)?e:"error",c="chip_blocked:".concat(r.chipClickId);return!s.has(c)&&(s.add(c),(0,i.Rg)({eventType:"chip_blocked",fitCheckId:r.parentFitCheckId||null,metadata:{chip_label:r.chip_label,chip_category:r.chip_category,chip_lever:null!=(t=r.chip_lever)?t:null,parent_fit_check_id:r.parentFitCheckId,chip_click_id:r.chipClickId,reason:l,ms_since_click:Math.max(0,Date.now()-r.ts),...n},sourceComponent:"chipOrigin"}),!0)}let d=null;function h(e){d=e||null}function u(){let e=d;return d=null,e}let _=null,g=new Set;function p(e){_=e&&e.verdict?e:null}function f(){let{verdict:e,fitCheckId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!_)return;let n=_;_=null;let a=t||n.fitCheckId||null,o="verdict_flip:".concat(a,":").concat(n.verdict,"->").concat(e);g.has(o)||(g.add(o),(0,i.Rg)({eventType:"verdict_flip",verdict:e,fitCheckId:a,metadata:{default_verdict:n.verdict,refined_verdict:e,flipped:n.verdict!==e,assumed_kind:n.assumedKind||null,idempotency_key:o},sourceComponent:"useConversation"}))}function w(e){var t,n,i,a;return e&&e.chip_label?(c("superseded"),o={chip_label:e.chip_label,parentFitCheckId:null!=(t=e.parentFitCheckId)?t:null,chip_category:null!=(n=e.chip_category)?n:null,chip_lever:null!=(i=e.chip_lever)?i:null,parentVerdict:null!=(a=e.parentVerdict)?a:null,chipClickId:function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID()}catch(e){}return"chip_".concat(Date.now().toString(36),"_").concat(Math.random().toString(36).slice(2,10))}(),ts:Date.now()},m(),"function"==typeof setTimeout&&(r=setTimeout(()=>{r=null,c("timeout")},12e4))&&"function"==typeof r.unref&&r.unref(),o.chipClickId):null}function v(e){if(!e||"assistant"!==e.role||e.isTeaser)return null;if(e.isTokenGate)return"paywall";if(e.isError||e.errorType)return"error";let t=e.parsed||{},n=e.solverMetadata||t.solverMetadata||null;return"CLARIFY"===((null==n?void 0:n.verdict)||t.verdict||null)||e.showAdditionalDetailsPrompt||e.needsCarSelection||t.needsCarSelection||e.pendingStairSelection||t.pendingStairSelection||!1===t.pipeline_complete?"clarify":"no_fit_check_id"}function b(){var e;return null!=(e=null==o?void 0:o.chip_lever)?e:null}function y(){var e,t,n;return o?{category:null!=(e=o.chip_category)?e:null,parentFitCheckId:null!=(t=o.parentFitCheckId)?t:null,chipClickId:null!=(n=o.chipClickId)?n:null}:null}function T(e){var t,n;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e5;if(!o)return null;let t=Date.now()-o.ts<=e?o:null;return o=null,m(),t}();if(!r)return;let s="chip_completed:".concat(e);
1if(l.has(s))return;l.add(s);let{verdict:c=null}=a,d=null!=(t=r.parentVerdict)?t:null;(0,i.Rg)({eventType:"chip_completed",verdict:c||null,fitCheckId:e,metadata:{chip_label:r.chip_label,chip_category:r.chip_category,chip_lever:null!=(n=r.chip_lever)?n:null,parent_fit_check_id:r.parentFitCheckId,new_fit_check_id:e,chip_click_id:r.chipClickId,ms_since_click:Math.max(0,Date.now()-r.ts),verdict_changed:c&&d?c!==d:null,idempotency_key:s},sourceComponent:"useConversation"})}},96848:(e,t,n)=>{n.d(t,{p:()=>i,u:()=>a});let i="Elevator geometry only. A continuous delivery route from the hallway through the door into the cab has not been verified. Confirm the hallway approach, door position, and available turning space; a 3D view shows the modeled geometry, not a proven delivery path.";function a(e){var t,n;return null!=(n=[e.margin_mm,null==(t=e.tightestPoint)?void 0:t.clearance_mm,e.tightestMargin_mm].find(Number.isFinite))?n:null}},97413:(e,t,n)=>{n.d(t,{Nq:()=>o,gL:()=>r,oi:()=>s,s5:()=>l});var i=n(3732);function a(e){let t={};for(let n of e){let e=function(e){var t,n,i;return e.height_in>60?"appliance_large":((null==(t=e.rule)?void 0:t.weight_lbs)||0)>120?"appliance_medium":e.width_in>70||e.depth_in>70?"furniture_long":(null==(i=e.rule)||null==(n=i.category)?void 0:n.startsWith("box"))?"boxes":"furniture_block"}(n);t[e]||(t[e]=[]),t[e].push(n)}return t}function o(e,t){return e.map(e=>{let n=e.height_in>0?Math.floor(t/e.height_in):1,i=Math.max(1,Math.min(e.maxStack,n,e.qty)),a=Math.ceil(e.qty/i),o=e.height_in*i;return{...e,actualStack:i,floorPositions:a,totalFootprint_in2:e.footprint_in2*a,stackedHeight_in:o}})}function r(e){let t=a(e),n=0;for(let[,e]of Object.entries(t))n+=e.reduce((e,t)=>e+t.totalFootprint_in2,0);return n}function l(e,t){let n=t.floor_width_in,i=t.floor_length_in,o=a(e),r=0;for(let[,e]of Object.entries(o))for(let t of e){if(0===t.floorPositions)continue;let e=[{w:t.width_in,d:t.depth_in},{w:t.depth_in,d:t.width_in}],i=0,a=1/0;for(let o of e){let e=Math.floor(n/o.w);if(e>0){let n=Math.ceil(t.floorPositions/e)*o.d;(e>i||e===i&&n<a)&&(i=e,a=n)}}if(0===i)return"".concat(t.name," (").concat(t.width_in,"\xd7").concat(t.depth_in,'") cannot fit across ').concat(n,'" width');r+=a}return r>i?"Row layout requires ".concat(Math.round(r),'" length, space has ').concat(i,'"'):null}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"theoretical";return e.map(e=>{let n=(0,i.bD)(e.name,t),a=(null==n?void 0:n.max_stack)||1,o=(e.width_in||0)*(e.depth_in||0),r=e.height_in||0,l=((null==n?void 0:n.weight_lbs)||0)*e.qty;return{...e,rule:n,maxStack:a,footprint_in2:o,height_in:r,weight_lbs:l}})}},97754:(e,t,n)=>{function i(e){return"string"==typeof e&&/^FITS/i.test(e)}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(e||[]).filter(e=>e&&e.displayName),n=t.filter(e=>i(e.verdict)),a=n.length>0,o=null;return n.length?o=n.reduce((e,t)=>(Number.isFinite(t.marginMm)?t.marginMm:1/0)<(Number.isFinite(e.marginMm)?e.marginMm:1/0)?t:e):t.length&&(o=t.reduce((e,t)=>(Number.isFinite(t.marginMm)?t.marginMm:-1/0)>(Number.isFinite(e.marginMm)?e.marginMm:-1/0)?t:e)),{closestName:o?o.displayName:null,anyOneTrip:a}}function o(e,t,n){return{...e,queryType:"vehicle",comparisonGroupId:t,sessionId:n}}function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(e||[]).filter(e=>e&&e.displayName),n=t.length,a=t.filter(e=>i(e.verdict)).length;return 0===n?{token:"DOESNT_FIT",headline:"No fit",fitCount:0,total:0}:a===n?{token:"FITS",headline:2===n?"Fits both":"Fits all ".concat(n),fitCount:a,total:n}:0===a?{token:"DOESNT_FIT",headline:2===n?"Fits neither":"Fits none",fitCount:a,total:n}:{token:"PARTIAL",headline:"Fits ".concat(a," of ").concat(n),fitCount:a,total:n}}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(e||[]).findIndex(e=>e&&"awaiting_pick"===e.status);return -1===t?null:t}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return(e||[]).map((e,i)=>i===t?{...e,status:"resolved",resolved:n}:e)}n.d(t,{EB:()=>r,Ln:()=>a,bs:()=>s,ie:()=>o,y6:()=>l})},98478:(e,t,n)=>{n.d(t,{solveCapacity:()=>m});var i=n(58271),a=n(76683),o=n(3732),r=n(92970);n(97413);var l=n(85850);let s=1/25.4;function m(e,t){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.classification||{intent:"capacity",scope:"multi_identical",constraint:"container",model:"rigid"},r=function(e){if(!e.length_mm&&e.depth_mm&&(e={...e,length_mm:e.width_mm||0,width_mm:e.depth_mm}),e.length_mm&&e.width_mm&&e.height_mm)return e;let t=(0,a.getItemDimensions)(e.name);if(null==t?void 0:t.dimensions){let n=t.dimensions;return{...e,length_mm:e.length_mm||25.4*(n.length||n.depth||0),width_mm:e.width_mm||25.4*(n.width||0),height_mm:e.height_mm||25.4*(n.height||0)}}return e}(e),l=(n=t).length_mm&&n.width_mm?n:!n.length_mm&&n.depth_mm?{...n,length_mm:n.depth_mm}:n.length_mm||n.depth_mm||!n.width_mm?n:{...n,length_mm:n.width_mm},s=function(e,t){if(!e.length_mm||!e.width_mm)return b(e,t,"I need the dimensions of ".concat(e.name||"the item"," to estimate capacity."));if(!t.length_mm||!t.width_mm)return b(e,t,"I need the dimensions of ".concat(t.name||"the space"," to estimate capacity."));let n=d(e.length_mm,e.width_mm,e.height_mm||0),i=d(t.length_mm,t.width_mm,t.height_mm||1/0);return n[0]>i[0]||n[1]>i[1]?v(e,t):null}(r,l);if(s)return s;let m=(0,c[function(e){let t=(e.type||"").toLowerCase();return["room","bedroom","living room","office","garage","space","closet","attic","basement"].includes(t)?"room":["vehicle","truck","van","moving van","moving truck"].includes(t)?"vehicle":"container"}(l)])(r,l,o,void 0!==i.allowedOrientations?i.allowedOrientations:null);return("hybrid"===o.constraint&&(m.assumptions=[...m.assumptions||[],"Path constraints (door size) not factored 
1in — capacity only"]),"approximate_soft"===o.model)?function(e,t){if("DOESNT_FIT"===e.verdict||"CLARIFY"===e.verdict)return e;let n=e.recommendedCount,i=Math.floor(.7*n),a=Math.ceil(1.3*n);return{...e,fuzzyRange:{low:i,high:a},softItemDisclaimer:"These items are soft/compressible — actual count depends on how tightly you pack them. This estimate assumes rigid packing.",confidence:"HIGH"===e.confidence?"MEDIUM":e.confidence,classification:t}}(m,o):m}let c={room:function(e,t,n,i){let a=t.length_mm*s,r=t.width_mm*s,l=t.height_mm?t.height_mm*s:96,m=e.length_mm*s,c=e.width_mm*s,d=e.height_mm?e.height_mm*s:0;if(d>0&&d>l)return v(e,t,"Item is taller than the ceiling");let g=(0,o.bD)(e.name||"","theoretical"),p=(null==g?void 0:g.stackable)||!1,f=p&&(null==g?void 0:g.max_stack)||1,b=d>0&&l<1/0?Math.floor(l/d):1,y=Math.max(1,Math.min(f,b)),T=[{l:m,w:c,h:d,label:"standard"},{l:c,w:m,h:d,label:"rotated 90\xb0"}],I=h(T,i);if(0===I.length)return v(e,t,"No valid orientation after path constraints");let M=null;for(let e of I){let t=_(a,r,e.l,e.w,30),n={recommendedCount:Math.min(t*y,1e3),practicalCount:Math.min(_(a,r,e.l,e.w,15)*y,1e3),maxCount:Math.min(_(a,r,e.l,e.w,0)*y,1e3),orientation:e,floorCount:t};(!M||n.recommendedCount>M.recommendedCount||n.recommendedCount===M.recommendedCount&&n.maxCount>M.maxCount)&&(M=n)}let S=T.map(e=>{let t=_(a,r,e.l,e.w,30),n=!I.some(t=>1>Math.abs(t.l-e.l)&&1>Math.abs(t.w-e.w)),i=M.orientation===e||.01>Math.abs(M.orientation.l-e.l)&&.01>Math.abs(M.orientation.w-e.w);return{l:e.l,w:e.w,h:e.h,label:e.label,count:t,total:Math.min(t*y,1e3),winner:i&&!n,filtered:n}}),k={recommended:u(a,r,M.orientation,30,y),practical:u(a,r,M.orientation,15,y),max:u(a,r,M.orientation,0,y)},N=k.recommended,x=N.usableL_in-Math.floor(N.usableL_in/M.orientation.l)*M.orientation.l,E=N.usableW_in-Math.floor(N.usableW_in/M.orientation.w)*M.orientation.w,D=m*c,F=a*r,C=F>0?Math.round(M.recommendedCount*D/y/F*100):0,O=F>0?Math.round(M.floorCount*D/F*100):0,R=m*c*d,A=a*r*l,L=M.recommendedCount/y,P={floorCoveragePercent:O,volumeUsagePercent:y>1&&d>0?Math.round(M.recommendedCount*R/A*1e3)/10:null,itemFootprint_sqin:Math.round(100*D)/100,totalFootprint_sqin:Math.round(L*D*10)/10,containerFloorArea_sqin:Math.round(100*F)/100,itemVolume_cuin:d>0?Math.round(10*R)/10:null,totalItemVolume_cuin:d>0?Math.round(M.recommendedCount*R*10)/10:null,containerVolume_cuin:l>0?Math.round(10*A)/10:null},U=function(e,t){let n=e.recommendedCount;return 0===n?"None fit":1===n?"1 ".concat(t||"item"," placed against the wall"):"".concat(n," placed in axis-aligned grid layout")}(M,e.name),H=t.length_mm&&t.width_mm&&e.length_mm&&e.width_mm;return w({item:e,container:t,classification:n,recommendedCount:M.recommendedCount,practicalCount:M.practicalCount,maxCount:M.maxCount,strategy:"room_layout",containerType:"room",confidence:H?"MEDIUM":"LOW",stackable:p&&y>1,orientationsUsed:[M.orientation],arrangement:U,utilizationPercent:C,clearance:{type:"walkway",applied_mm:762,description:"".concat(30,'" walkway clearance assumed')},assumptions:["Standard ".concat(30,'" walkway clearance assumed'),"No obstructions modeled (doors, windows, radiators)","Axis-aligned placement only"],stackLayers:y,stackRuleMax:f,stackRuleReason:(null==g?void 0:g.reason)||null,stackRuleSource:(null==g?void 0:g.category)||null,stackingMode:"theoretical",ceilingLayers:b,allOrientations:S,tiers:k,remainder:{length_in:Math.round(10*x)/10,width_in:Math.round(10*E)/10},coverage:P})},vehicle:function(e,t,n,i){let a,l,m,c,d,u=e.length_mm*s,_=e.width_mm*s,f=e.height_mm?e.height_mm*s:0,b=(0,r.getCandidateSpaces)("vehicle").find(e=>t.name&&e.name.toLowerCase().includes(t.name.toLowerCase()));if(b?(a=b.floor_length_in,l=b.floor_width_in,m=b.interior_height_in,c=b.door_width_in,d=b.payload_lbs):(a=t.length_mm*s,l=t.width_mm*s,m=t.height_mm?t.height_mm*s:96,c=null,d=null),f>0&&f>m)return v(e,t,"Item is taller than vehicle interior");if(c){let n=Math.min(u,_);if(n>c)return v(e,t,"Item's narrowest face (".concat(Math.round(n),'") exceeds door width (').concat(c,'")'))}let y=(0,o.bD)(e.name||"","logistics"),T=(null==y?void 0:y.max_stack)||1,I=f>0&&m>0?Math.floor(m/f):1,M=Math.max(1,Math.min(T,I)),S=[{l:u,w:_,h:f,label:"standard"},{l:_,w:u,h:f,label:"rotated 90\xb0"}],k=h(S,i);if(0===k.length)return v(e,t,"No valid orientation after path constraints");let N=null;for(let e of k){let t=p(a,l,e.l,e.w,.75)*M,n={recommendedCount:Math.min(t,1e3),practicalCount:Math.min(p(a,l,e.l,e.w,.9)*M,1e3),maxCount:Math.min(p(a,l,e.l,e.w,1)*M,1e3),orientation:e};(!N||n.recommendedCount>N.recommendedCount||n.recommendedCount===N.recommendedCount&&n.maxCount>N.maxCount)&&(N=n)}let x=(null==y?void 0:y.weight_lbs)||0,E=null;if(d&&x>0){let e=Math.floor(d/x);e<N.maxCount&&(E="Weight limit (".concat(d," lbs) restricts count to ").concat(e),N.recommendedCount=Math.min(N.recommendedCount,e),N.practicalCount=Math.min(N.practicalCount,e),N.maxCount=Math.min(N.maxCount,e))}let D=S.map(e=>{let t=p(a,l,e.l,e.w,.75),n=!k.some(t=>1>
1Math.abs(t.l-e.l)&&1>Math.abs(t.w-e.w)),i=N.orientation===e||.01>Math.abs(N.orientation.l-e.l)&&.01>Math.abs(N.orientation.w-e.w);return{l:e.l,w:e.w,h:e.h,label:e.label,count:t,total:Math.min(t*M,1e3),winner:i&&!n,filtered:n}}),F={recommended:g(a,l,N.orientation,.75,M),practical:g(a,l,N.orientation,.9,M),max:g(a,l,N.orientation,1,M)};if(E){let e=Math.floor(d/x);F.recommended.total=Math.min(F.recommended.total,e),F.practical.total=Math.min(F.practical.total,e),F.max.total=Math.min(F.max.total,e)}let C=a*l*m,O=u*_*(f||1),R=C>0?Math.round(N.recommendedCount*O/C*100):0,A=u*_,L=a*l,P=N.recommendedCount/M,U={floorCoveragePercent:L>0?Math.round(P*A/L*100):0,volumeUsagePercent:f>0&&m>0?Math.round(N.recommendedCount*O/C*1e3)/10:null,itemFootprint_sqin:Math.round(100*A)/100,totalFootprint_sqin:Math.round(P*A*10)/10,containerFloorArea_sqin:Math.round(100*L)/100,itemVolume_cuin:f>0?Math.round(10*O)/10:null,totalItemVolume_cuin:f>0?Math.round(N.recommendedCount*O*10)/10:null,containerVolume_cuin:m>0?Math.round(10*C)/10:null},H=.75*a,W=H-Math.floor(H/N.orientation.l)*N.orientation.l,G=l-Math.floor(l/N.orientation.w)*N.orientation.w,q=["Logistics-mode stacking rules applied","Items packed in rows from back to front","Axis-aligned placement only"];E&&q.push(E);let j=e.height_mm&&t.height_mm?"MEDIUM":"LOW";return w({item:e,container:t,classification:n,recommendedCount:N.recommendedCount,practicalCount:N.practicalCount,maxCount:N.maxCount,strategy:"3d_packing",containerType:"vehicle",confidence:j,stackable:M>1,orientationsUsed:[N.orientation],arrangement:"Packed in rows, ".concat(M>1?"stacked ".concat(M," high"):"single layer"),utilizationPercent:R,clearance:{type:"access",applied_mm:0,description:"Logistics usability factor applied (75% recommended)"},assumptions:q,stackLayers:M,stackRuleMax:T,stackRuleReason:(null==y?void 0:y.reason)||null,stackRuleSource:(null==y?void 0:y.category)||null,stackingMode:"logistics",ceilingLayers:I,allOrientations:D,tiers:F,remainder:{length_in:Math.round(10*W)/10,width_in:Math.round(10*G)/10},coverage:U})},container:function(e,t,n,i){let a=e.length_mm*s,r=e.width_mm*s,l=e.height_mm?e.height_mm*s:0,m=t.length_mm*s,c=t.width_mm*s,d=t.height_mm?t.height_mm*s:0,u=l>0&&d>0,_=(0,o.bD)(e.name||"","theoretical"),g=(null==_?void 0:_.max_stack)||(u?999:1),p=u?[{l:a,w:r,h:l,label:"upright"},{l:r,w:a,h:l,label:"rotated 90\xb0"},{l:a,w:l,h:r,label:"on side"},{l:l,w:r,h:a,label:"on end"}]:[{l:a,w:r,h:l||1,label:"standard"},{l:r,w:a,h:l||1,label:"rotated 90\xb0"}],b=h(p,i);if(0===b.length)return v(e,t,"No valid orientation after path constraints");let y=0,T=b[0];for(let e of b){let t=f(m,c,d||e.h,e.l,e.w,e.h,g);t>y&&(y=t,T=e)}let I=Math.max(0,Math.floor(.95*(y=Math.min(y,1e3)))),M=y,S=y;if(0===y)return v(e,t);let k=p.map(e=>{let t=f(m,c,d||e.h,e.l,e.w,e.h,g),n=!b.some(t=>1>Math.abs(t.l-e.l)&&1>Math.abs(t.w-e.w)),i=T===e||.01>Math.abs(T.l-e.l)&&.01>Math.abs(T.w-e.w);return{l:e.l,w:e.w,h:e.h,label:e.label,count:t,total:Math.min(Math.floor(.95*t),1e3),winner:i&&!n,filtered:n}}),N={recommended:{gapFactor:.95,rawCount:y,total:I},practical:{rawCount:y,total:M},max:{rawCount:y,total:S}},x=m*c*(d||1),E=a*r*(l||1),D=x>0?Math.round(I*E/x*100):0,F=a*r,C=m*c,O=d||T.h,R=O>0&&T.h>0?Math.min(Math.floor(O/T.h),g):1,A=R>0?I/Math.max(1,R):I,L={floorCoveragePercent:C>0?Math.round(A*F/C*100):0,volumeUsagePercent:u?Math.round(I*E/x*1e3)/10:null,itemFootprint_sqin:Math.round(100*F)/100,totalFootprint_sqin:Math.round(A*F*10)/10,containerFloorArea_sqin:Math.round(100*C)/100,itemVolume_cuin:l>0?Math.round(10*E)/10:null,totalItemVolume_cuin:l>0?Math.round(I*E*10)/10:null,containerVolume_cuin:d>0?Math.round(10*x)/10:null},P=Math.floor(m/T.l),U=Math.floor(c/T.w),H=m-P*T.l,W=c-U*T.w,G=l>0&&d>0||a>0&&r>0&&m>0&&c>0?"HIGH":"MEDIUM",q=u?Math.floor(d/T.h):1,j=Math.max(1,Math.min(g,q));return w({item:e,container:t,classification:n,recommendedCount:I,practicalCount:M,maxCount:S,strategy:u?"3d_packing":"2d_packing",containerType:"container",confidence:G,stackable:u&&g>1,orientationsUsed:[T],arrangement:"Grid packing, ".concat(T.label),utilizationPercent:D,clearance:{type:"packing_gap",applied_mm:0,description:"5% packing gap deducted for recommended count"},assumptions:["Axis-aligned placement only","No packing material gaps modeled"],stackLayers:j,stackRuleMax:g,stackRuleReason:(null==_?void 0:_.reason)||null,stackRuleSource:(null==_?void 0:_.category)||null,stackingMode:"theoretical",ceilingLayers:q,allOrientations:k,tiers:N,remainder:{length_in:Math.round(10*H)/10,width_in:Math.round(10*W)/10},coverage:L})}};function d(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(e=>e&&isFinite(e)).sort((e,t)=>
1e-t)}function h(e,t){return t?0===t.length?[]:e.filter(e=>t.some(t=>1>Math.abs(e.l-t.l)&&1>Math.abs(e.w-t.w))):e}function u(e,t,n,i,a){let o=e-i,r=t-i,l=_(e,t,n.l,n.w,i);return{clearance_in:i,usableL_in:Math.round(10*o)/10,usableW_in:Math.round(10*r)/10,count:l,total:Math.min(l*a,1e3)}}function _(e,t,n,i,a){let o=e-a,r=t-a;return o<=0||r<=0||n<=0||i<=0?0:Math.max(0,Math.floor(o/n)*Math.floor(r/i))}function g(e,t,n,i,a){let o=e*i,r=p(e,t,n.l,n.w,i);return{usabilityFactor:i,effectiveL_in:Math.round(10*o)/10,count:r,total:Math.min(r*a,1e3)}}function p(e,t,n,i,a){let o=e*a;return o<=0||t<=0||n<=0||i<=0?0:Math.max(0,Math.floor(o/n)*Math.floor(t/i))}function f(e,t,n,i,a,o,r){return i<=0||a<=0||o<=0||e<=0||t<=0?0:Math.floor(e/i)*Math.floor(t/a)*Math.max(1,n>0&&o>0?Math.min(Math.floor(n/o),r):1)}function w(e){let{item:t,container:n,classification:a,recommendedCount:o,practicalCount:r,maxCount:s,strategy:m,containerType:c,confidence:d,stackable:h,orientationsUsed:u,arrangement:_,utilizationPercent:g,clearance:p,assumptions:f,stackLayers:w,stackRuleMax:v,stackRuleReason:b,stackRuleSource:y,stackingMode:T,ceilingLayers:I,allOrientations:M,tiers:S,remainder:k,coverage:N}=e;((null==t?void 0:t.dimensionSource)||(null==n?void 0:n.dimensionSource))&&i.U.log("[CAPACITY-SOLVER] result.item/container provenance:",JSON.stringify({item:{name:t.name,dimensionSource:t.dimensionSource,_userLockedDims:t._userLockedDims||void 0,_unitInferred:t._unitInferred||void 0,_fromLLM:t._fromLLM||void 0},container:{name:n.name,dimensionSource:n.dimensionSource,_unitInferred:n._unitInferred||void 0,_fromLLM:n._fromLLM||void 0}}));let x=(0,l.pl)([{axis:"length",item_mm:t.length_mm,space_mm:n.length_mm},{axis:"width",item_mm:t.width_mm,space_mm:n.width_mm},...t.height_mm&&n.height_mm?[{axis:"height",item_mm:t.height_mm,space_mm:n.height_mm}]:[]]).map(e=>({...e,limiting:!1})),E=(t.length_mm||0)*(t.width_mm||0)*(t.height_mm||1),D=(n.length_mm||0)*(n.width_mm||0)*(n.height_mm||1),F=[...x,(0,l.hp)({totalVolMm3:E*Math.max(1,o||0),containerVolMm3:D,limiting:!0})];return{verdict:o>=1?"FITS":"DOESNT_FIT",margin_mm:0,confidence:d,method:"capacity_solver",queryType:"capacity",proofSteps:F,itemDims_mm:{length:t.length_mm,width:t.width_mm,height:t.height_mm||0},spaceDims_mm:{length_mm:n.length_mm,width_mm:n.width_mm,height_mm:n.height_mm||0},recommendedCount:o,practicalCount:r,maxCount:s,strategy:m,containerType:c,item:{name:t.name,length_mm:t.length_mm,width_mm:t.width_mm,height_mm:t.height_mm||0,...t.dimensionSource&&{dimensionSource:t.dimensionSource},...t._userLockedDims&&{_userLockedDims:t._userLockedDims},...t._unitInferred&&{_unitInferred:t._unitInferred,_inferredUnit:t._inferredUnit,_inferredUnitSource:t._inferredUnitSource},...t._fromLLM&&{_fromLLM:t._fromLLM},...t.source_quote&&{source_quote:t.source_quote}},container:{name:n.name,length_mm:n.length_mm,width_mm:n.width_mm,height_mm:n.height_mm||0,...n.dimensionSource&&{dimensionSource:n.dimensionSource},...n._unitInferred&&{_unitInferred:n._unitInferred,_inferredUnit:n._inferredUnit,_inferredUnitSource:n._inferredUnitSource},...n._fromLLM&&{_fromLLM:n._fromLLM},...n.source_quote&&{source_quote:n.source_quote}},packing:{arrangement:_,stackable:!!h,orientationsUsed:u||[],...void 0!==w&&{stackLayers:w,stackRuleMax:v,stackRuleReason:b,stackRuleSource:y,stackingMode:T,ceilingLayers:I},...M&&{allOrientations:M}},remaining:{utilizationPercent:Math.min(100,Math.max(0,g)),note:g<100?"Remaining space is fragmented across gaps between items":"Fully packed"},clearance:p||{type:"none",applied_mm:0,description:"No clearance applied"},classification:a,fuzzyRange:null,softItemDisclaimer:null,assumptions:f||[],...S&&{tiers:S},...N&&{coverage:N},...k&&{remainder:k}}}function v(e,t,n){let i=(0,l.pl)([{axis:"length",item_mm:e.length_mm,space_mm:t.length_mm},{axis:"width",item_mm:e.width_mm,space_mm:t.width_mm},...e.height_mm&&t.height_mm?[{axis:"height",item_mm:e.height_mm,space_mm:t.height_mm}]:[]]),a=(e.length_mm||0)*(e.width_mm||0)*(e.height_mm||1),o=(t.length_mm||0)*(t.width_mm||0)*(t.height_mm||1),r=(0,l.hp)({totalVolMm3:a,containerVolMm3:o,limiting:!1}),s=e.length_mm||0,m=e.width_mm||0,c=e.height_mm||0,d=(0,l.kj)({itemFace:{a_mm:s,b_mm:m},spaceFace:{a_mm:t.length_mm||0,b_mm:t.width_mm||0},itemReach:{l_mm:s,w_mm:m,h_mm:c},spaceReachDiag_mm:Math.sqrt((t.length_mm||0)**2+(t.width_mm||0)**2+(t.height_mm||0)**2),fits:!1}),h=(0,l.ke)(i,{tolerance_mm:0});return{verdict:"DOESNT_FIT",margin_mm:0,confidence:"HIGH",method:"capacity_solver",queryType:"capacity",proofSteps:[...i,r,...d,...h.slice(i.length)],itemDims_mm:{length:e.length_mm||0,width:e.width_mm||0,height:e.height_mm||0},spaceDims_mm:{length_mm:t.length_mm||0,width_mm:t.width_mm||0,height_mm:t.height_mm||0},recommendedCount:0,practicalCount:0,maxCount:0,strategy:null,containerType:t.type||"unknown",item:{name:e.name,length_mm:e.length_mm||0,width_mm:e.width_mm||0,height_mm:e.height_mm||0,...e.dimensionSource&&{dimensionSource:e.dimensionSource},...e._userLockedDims&&{_userLockedDims:e._userLockedDims}},container:{name:t.name,length_mm:t.length_mm||0,width_mm:t.width_mm||0,height_mm:t.height_mm||0},packing:{arrangement:"None — item does not fit",stackable:!1,orientationsUsed:[]},remaining:{utilizationPercent:0,note:n||"Item is larger than the space"},clearance:{type:"none",applied_mm:0,description:"N/A"},classification:{intent:"capacity",scope:"multi_identical",constraint:"container",model:"rigid"},fuzzyRange:null,softItemDisclaimer:null,assumptions:[]}}function b(e,t,n){return{verdict:"CLARIFY",margin_mm:0,confidence:"LOW",method:"capacity_solver",queryType:"capacity",recommendedCount:0,practicalCount:0,maxCount:0,strategy:null,containerType:(null==t?void 0:t.type)||"unknown",item:{name:(null==e?void 0:e.name)||"unknown",length_mm:(null==e?void 0:e.length_mm)||0,width_mm:(null==e?void 0:e.width_mm)||0,height_mm:(null==e?void 0:e.he
1ight_mm)||0},container:{name:(null==t?void 0:t.name)||(null==t?void 0:t.type)||"unknown",length_mm:(null==t?void 0:t.length_mm)||0,width_mm:(null==t?void 0:t.width_mm)||0,height_mm:(null==t?void 0:t.height_mm)||0},packing:{arrangement:null,stackable:!1,orientationsUsed:[]},remaining:{utilizationPercent:0,note:n},clearance:{type:"none",applied_mm:0,description:"N/A"},classification:{intent:"capacity",scope:"multi_identical",constraint:"container",model:"rigid"},fuzzyRange:null,softItemDisclaimer:null,clarifyMessage:n,assumptions:[]}}},98524:(e,t,n)=>{n.d(t,{C3:()=>d,Rw:()=>c});var i=n(58271),a=n(74737),o=n(89175),r=n(45263),l=n(89609),s=n(27236),m=n(85850);function c(e){let{width_mm:t,depth_mm:n,height_mm:i}=e,a=[t,n,i].filter(e=>null!=e);return a.length<2?[]:2===a.length?[{acrossHallway:a[0],vertical:a[1],alongHallway:void 0},{acrossHallway:a[1],vertical:a[0],alongHallway:void 0}]:[{acrossHallway:t,vertical:i,alongHallway:n},{acrossHallway:t,vertical:n,alongHallway:i},{acrossHallway:i,vertical:t,alongHallway:n},{acrossHallway:i,vertical:n,alongHallway:t},{acrossHallway:n,vertical:t,alongHallway:i},{acrossHallway:n,vertical:i,alongHallway:t}]}function d(e,t){var n,d;let h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null!=(n=h.tolerance_mm)?n:a.KL.hallway;if(!e||!t)return{verdict:"UNKNOWN",unknown_reason:e?s.r.MISSING_SPACE_DIMS:s.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_dimensions",checked_orientations:[],assumptions:["Item or hallway dimensions not provided"],tolerance_mm:u,confidence:"LOW",needs_user_input:[!e?"Item dimensions":null,!t?"Hallway dimensions":null].filter(Boolean)};if(!t.width_mm)return{verdict:"UNKNOWN",unknown_reason:s.r.MISSING_SPACE_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"missing_hallway_width",checked_orientations:[],assumptions:[],tolerance_mm:u,confidence:"LOW",needs_user_input:["Hallway width"]};if(t.has_turn||t.width_after_mm||t.inside_corner_mm){let n={width_mm:t.width_mm,width_after_mm:t.width_after_mm||t.width_mm,height_mm:t.height_mm,inside_corner_mm:t.inside_corner_mm,turn_angle:t.turn_angle||90};i.U.log("[HALLWAY] Turn delegation — turnSpace:",JSON.stringify(n)),i.U.log("[HALLWAY] Turn data from hallway:",{has_turn:t.has_turn,inside_corner_mm:t.inside_corner_mm,width_after_mm:t.width_after_mm,turn_angle:t.turn_angle});let o=(0,r.PU)(e,n,h),l=e.width_mm<=t.width_mm,s=e.height_mm<=(t.height_mm||a.aA.standard_ceiling.height_mm),m=l&&s,c=null,u=0,_=null,g=null==(d=o.details)?void 0:d.best_orientation;return m||"DOESNT_FIT"===o.verdict||"UNKNOWN"===o.verdict||(_=l?e.height_mm:e.width_mm,u=l?e.height_mm-(t.height_mm||a.aA.standard_ceiling.height_mm):e.width_mm-t.width_mm,c="reoriented"),o.details={...o.details,smallest_item_dimension_mm:null==g?void 0:g.across_hallway_mm,opening_width_mm:t.width_mm,opening_height_mm:t.height_mm||a.aA.standard_ceiling.height_mm,fitsStraightThrough:m,rotationNeeded:c,straightExcess_mm:Math.round(u),itemBlockingDim_mm:_,fittingDim_mm:null==g?void 0:g.across_hallway_mm,hallway_width_mm:t.width_mm,has_turn:!0},o}let _=[],g=t.height_mm;g||(g=a.aA.standard_ceiling.height_mm,_.push("Assumed standard ceiling height: 8ft"));let{orientationConstraint:p=null}=h,f=c(e);if(0===f.length)return{verdict:"UNKNOWN",unknown_reason:s.r.MISSING_ITEM_DIMS,margin_mm:null,margin_unknown_reason:"MARGIN_MISSING_REQUIRED_INPUT",limiting_constraint:"insufficient_item_dimensions",checked_orientations:[],assumptions:_,tolerance_mm:u,confidence:"LOW",needs_user_input:["Complete item dimensions (width \xd7 depth \xd7 height)"]};f=(0,l.sH)(f,p,e),p&&_.push("Only checking orientations where the item is ".concat({upright:"upright",flat:"flat",on_side:"on its side"}[p]||p," (as requested)."));let w=f.map(e=>{let n=t.width_mm-e.acrossHallway,i=g-e.vertical,a=Math.min(n,i);return{...e,widthMargin:n,heightMargin:i,minMargin:a,physicallyFits:a>=0}}),v=w.filter(e=>e.physicallyFits),b=e=>{if(!e)return null;let n=e.widthMargin<=e.heightMargin,i=[{id:"axis_inequality",passed:e.widthMargin>=0,values:{item_dim_mm:Math.round(e.acrossHallway),space_dim_mm:Math.round(t.width_mm),axis:"hallway_width",margin_mm:Math.round(e.widthMargin)},comparison:{actual_mm:Math.round(e.acrossHallway),limit_mm:Math.round(t.width_mm),margin_mm:Math.round(e.widthMargin)},limiting:n},{id:"axis_inequality",passed:e.heightMargin>=0,values:{item_dim_mm:Math.round(e.vertical),space_dim_mm:Math.round(g),axis:"hallway_height",margin_mm:Math.round(e.heightMargin)},comparison:{actual_mm:Math.round(e.vertical),limit_mm:Math.round(g),margin_mm:Math.round(e.heightMargin)},limiting:e.heightMargin<e.widthMargin}],a=(n?e.widthMargin:e.heightMargin)>=0,o=Math.sqrt(t.width_mm**2+g**2);return i.push(...(0,m.kj)({itemFace:{a_mm:e.acrossHallway,b_mm:e.vertical},spaceFace:{a_mm:t.width_mm,b_mm:g},itemReach:{l_mm:e.alongHallway,w_mm:e.acrossHallway,h_mm:e.vertical},spaceReachDiag_mm:o,fits:a})),a||i.push(...(0,m.Ew)({limitingAxis:n?"hallway_width":"hallway_height",itemDim_mm:n?e.acrossHallway:e.vertical,spaceDim_mm:n?t.width_mm:g,tolerance_mm:u})),i};if(0===v.length){let n=[...w].sort((e,t)=>
1e.acrossHallway-t.acrossHallway)[0];return{verdict:"DOESNT_FIT",margin_mm:n.minMargin,limiting_constraint:n.widthMargin<n.heightMargin?"hallway_width":"hallway_height",tightestPoint:{entityA:"item_".concat(n.widthMargin<n.heightMargin?"width":"height"),entityB:"hallway_".concat(n.widthMargin<n.heightMargin?"width":"height"),axis:n.widthMargin<n.heightMargin?"width":"height",clearance_mm:n.minMargin},geometryClass:"static",enrichedConfidence:"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],checked_orientations:w.map(e=>({orientation:"".concat(Math.round(e.acrossHallway),"mm across, ").concat(Math.round(e.vertical),"mm vertical"),dimensions_mm:{across_hallway:e.acrossHallway,vertical:e.vertical,along_hallway:e.alongHallway},feasible:!1,margin_mm:e.minMargin,width_clearance_mm:Math.round(e.widthMargin),height_clearance_mm:Math.round(e.heightMargin),rejection_reason:e.widthMargin<e.heightMargin?"too_wide":"too_tall"})),assumptions:_,tolerance_mm:u,confidence:"HIGH",search_space_exhausted:!0,details:{smallest_width_needed_mm:n.acrossHallway,hallway_width_mm:t.width_mm,difference_mm:n.acrossHallway-t.width_mm},proofSteps:b(n),orientationRationale:w.length>1?"Closest-fitting orientation chosen because its limiting axis (Step ".concat(n.widthMargin<=n.heightMargin?1:2,") had the smallest violation."):null,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{hallway_width_mm:t.width_mm,hallway_height_mm:g}}}let y=[...v].sort((e,t)=>t.minMargin-e.minMargin),T=null;if(y.some(e=>null!=e.alongHallway)){let e=null,n=-1/0;for(let i of y){if(null==i.alongHallway)continue;let a=(0,l.fI)(i.acrossHallway,t.width_mm);if(null==a)continue;let o=a-i.alongHallway;o>n&&(n=o,e=i)}if(e){let i=(0,l.fI)(e.acrossHallway,t.width_mm);T={fits:n>=0,corner_margin_mm:Math.round(n),bmax_mm:null!=i?Math.round(i):null,along_mm:e.alongHallway,best_orientation:{across_hallway_mm:e.acrossHallway,vertical_mm:e.vertical,along_hallway_mm:e.alongHallway}}}}let I=y[0],M=I.minMargin,{verdict:S}=(0,o.K8)(M),k=[];M<u&&k.push("Clearance (".concat(M,"mm) is below recommended minimum (").concat(u,"mm)")),M<100&&k.push("Watch for baseboards and wall fixtures"),I.alongHallway&&I.alongHallway>2440&&k.push("Item length exceeds typical hallway section - ensure clear path");let N=e.width_mm<=t.width_mm,x=e.height_mm<=g,E=N&&x,D=null,F=0,C=null;return!E&&I.physicallyFits&&(C=N?e.height_mm:e.width_mm,F=N?e.height_mm-g:e.width_mm-t.width_mm,D="reoriented"),{verdict:S,margin_mm:Math.round(M),limiting_constraint:I.widthMargin<I.heightMargin?"hallway_width":"hallway_height",tightestPoint:{entityA:"item_".concat(I.widthMargin<I.heightMargin?"width":"height"),entityB:"hallway_".concat(I.widthMargin<I.heightMargin?"width":"height"),axis:I.widthMargin<I.heightMargin?"width":"height",clearance_mm:Math.round(M)},geometryClass:"static",enrichedConfidence:_.length>0?"medium":"high",enrichedAssumptions:["hallway_unobstructed","consistent_hallway_width","item_rigid"],checked_orientations:w.map(e=>({orientation:"".concat(Math.round(e.acrossHallway),"mm across, ").concat(Math.round(e.vertical),"mm vertical"),dimensions_mm:{across_hallway:e.acrossHallway,vertical:e.vertical,along_hallway:e.alongHallway},feasible:e.physicallyFits,margin_mm:Math.round(e.minMargin),width_clearance_mm:Math.round(e.widthMargin),height_clearance_mm:Math.round(e.heightMargin),rejection_reason:e.physicallyFits?null:e.widthMargin<e.heightMargin?"too_wide":"too_tall"})),assumptions:_,tolerance_mm:u,confidence:_.length>0?"MEDIUM":"HIGH",search_space_exhausted:!0,method:"straight",details:{best_orientation:{across_hallway_mm:I.acrossHallway,vertical_mm:I.vertical,along_hallway_mm:I.alongHallway},width_clearance_mm:Math.round(I.widthMargin),height_clearance_mm:Math.round(I.heightMargin),smallest_item_dimension_mm:I.acrossHallway,opening_width_mm:t.width_mm,opening_height_mm:g,fitsStraightThrough:E,rotationNeeded:D,straightExcess_mm:Math.round(F),itemBlockingDim_mm:C,fittingDim_mm:I.acrossHallway,lCorner:T},warnings:k.length>0?k:void 0,proofSteps:b(I),orientationRationale:y.length>1?"Best orientation chosen because its limiting axis (Step ".concat(I.widthMargin<=I.heightMargin?1:2,") clears with the largest margin among all orientations."):null,itemDims_mm:{width:e.width_mm,depth:e.depth_mm,height:e.height_mm},spaceDims_mm:{hallway_width_mm:t.width_mm,hallway_height_mm:g}}}},99297:(e,t,n)=>{n.d(t,{i:()=>i}),n(95704);function i(){return"on"}}}]);

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.