@metron-labs/quote-react 0.1.57 → 0.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var ym=Ra(tt=>{"use strict";function Mc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<dl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function fl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>dl(l,a))c<i&&0>dl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>dl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function dl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}tt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(pm=performance,tt.unstable_now=function(){return pm.now()}):(Cc=Date,dm=Cc.now(),tt.unstable_now=function(){return Cc.now()-dm});var pm,Cc,dm,$a=[],wr=[],Iv=1,pa=null,Dt=3,Tc=!1,Zn=!1,Kn=!1,zc=!1,hm=typeof setTimeout=="function"?setTimeout:null,gm=typeof clearTimeout=="function"?clearTimeout:null,mm=typeof setImmediate<"u"?setImmediate:null;function ml(e){for(var t=Ua(wr);t!==null;){if(t.callback===null)fl(wr);else if(t.startTime<=e)fl(wr),t.sortIndex=t.expirationTime,Mc($a,t);else break;t=Ua(wr)}}function Ac(e){if(Kn=!1,ml(e),!Zn)if(Ua($a)!==null)Zn=!0,Ai||(Ai=!0,zi());else{var t=Ua(wr);t!==null&&Rc(Ac,t.startTime-e)}}var Ai=!1,Pn=-1,bm=5,wm=-1;function vm(){return zc?!0:!(tt.unstable_now()-wm<bm)}function qc(){if(zc=!1,Ai){var e=tt.unstable_now();wm=e;var t=!0;try{e:{Zn=!1,Kn&&(Kn=!1,gm(Pn),Pn=-1),Tc=!0;var a=Dt;try{t:{for(ml(e),pa=Ua($a);pa!==null&&!(pa.expirationTime>e&&vm());){var r=pa.callback;if(typeof r=="function"){pa.callback=null,Dt=pa.priorityLevel;var i=r(pa.expirationTime<=e);if(e=tt.unstable_now(),typeof i=="function"){pa.callback=i,ml(e),t=!0;break t}pa===Ua($a)&&fl($a),ml(e)}else fl($a);pa=Ua($a)}if(pa!==null)t=!0;else{var n=Ua(wr);n!==null&&Rc(Ac,n.startTime-e),t=!1}}break e}finally{pa=null,Dt=a,Tc=!1}t=void 0}}finally{t?zi():Ai=!1}}}var zi;typeof mm=="function"?zi=function(){mm(qc)}:typeof MessageChannel<"u"?(Ec=new MessageChannel,fm=Ec.port2,Ec.port1.onmessage=qc,zi=function(){fm.postMessage(null)}):zi=function(){hm(qc,0)};var Ec,fm;function Rc(e,t){Pn=hm(function(){e(tt.unstable_now())},t)}tt.unstable_IdlePriority=5;tt.unstable_ImmediatePriority=1;tt.unstable_LowPriority=4;tt.unstable_NormalPriority=3;tt.unstable_Profiling=null;tt.unstable_UserBlockingPriority=2;tt.unstable_cancelCallback=function(e){e.callback=null};tt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bm=0<e?Math.floor(1e3/e):5};tt.unstable_getCurrentPriorityLevel=function(){return Dt};tt.unstable_next=function(e){switch(Dt){case 1:case 2:case 3:var t=3;break;default:t=Dt}var a=Dt;Dt=t;try{return e()}finally{Dt=a}};tt.unstable_requestPaint=function(){zc=!0};tt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Dt;Dt=e;try{return t()}finally{Dt=a}};tt.unstable_scheduleCallback=function(e,t,a){var r=tt.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:Iv++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Mc(wr,e),Ua($a)===null&&e===Ua(wr)&&(Kn?(gm(Pn),Pn=-1):Kn=!0,Rc(Ac,a-r))):(e.sortIndex=i,Mc($a,e),Zn||Tc||(Zn=!0,Ai||(Ai=!0,zi()))),e};tt.unstable_shouldYield=vm;tt.unstable_wrapCallback=function(e){var t=Dt;return function(){var a=Dt;Dt=t;try{return e.apply(this,arguments)}finally{Dt=a}}}});var xm=Ra((vx,_m)=>{"use strict";_m.exports=ym()});var Rm=Ra(de=>{"use strict";var Oc=Symbol.for("react.transitional.element"),Fv=Symbol.for("react.portal"),Wv=Symbol.for("react.fragment"),e0=Symbol.for("react.strict_mode"),t0=Symbol.for("react.profiler"),a0=Symbol.for("react.consumer"),r0=Symbol.for("react.context"),i0=Symbol.for("react.forward_ref"),n0=Symbol.for("react.suspense"),o0=Symbol.for("react.memo"),qm=Symbol.for("react.lazy"),l0=Symbol.for("react.activity"),km=Symbol.iterator;function s0(e){return e===null||typeof e!="object"?null:(e=km&&e[km]||e["@@iterator"],typeof e=="function"?e:null)}var Em={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mm=Object.assign,Tm={};function Ui(e,t,a){this.props=e,this.context=t,this.refs=Tm,this.updater=a||Em}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zm(){}zm.prototype=Ui.prototype;function Bc(e,t,a){this.props=e,this.context=t,this.refs=Tm,this.updater=a||Em}var Lc=Bc.prototype=new zm;Lc.constructor=Bc;Mm(Lc,Ui.prototype);Lc.isPureReactComponent=!0;var Nm=Array.isArray;function Dc(){}var Ie={H:null,A:null,T:null,S:null},Am=Object.prototype.hasOwnProperty;function Hc(e,t,a){var r=a.ref;return{$$typeof:Oc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function c0(e,t){return Hc(e.type,t,e.props)}function jc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oc}function u0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Sm=/\/+/g;function Uc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?u0(""+e.key):t.toString(36)}function p0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Dc,Dc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ri(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Oc:case Fv:o=!0;break;case qm:return o=e._init,Ri(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+Uc(e,0):r,Nm(i)?(a="",o!=null&&(a=o.replace(Sm,"$&/")+"/"),Ri(i,t,a,"",function(p){return p})):i!=null&&(jc(i)&&(i=c0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Sm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(Nm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+Uc(r,c),o+=Ri(r,t,a,n,i);else if(c=s0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+Uc(r,c++),o+=Ri(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Ri(p0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function hl(e,t,a){if(e==null)return e;var r=[],i=0;return Ri(e,r,"","",function(n){return t.call(a,n,i++)}),r}function d0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Cm=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},m0={map:hl,forEach:function(e,t,a){hl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return hl(e,function(){t++}),t},toArray:function(e){return hl(e,function(t){return t})||[]},only:function(e){if(!jc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=l0;de.Children=m0;de.Component=Ui;de.Fragment=Wv;de.Profiler=t0;de.PureComponent=Bc;de.StrictMode=e0;de.Suspense=n0;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ie;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ie.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Mm({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Am.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Hc(e.type,i,r)};de.createContext=function(e){return e={$$typeof:r0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:a0,_context:e},e};de.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Am.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Hc(e,n,i)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:i0,render:e}};de.isValidElement=jc;de.lazy=function(e){return{$$typeof:qm,_payload:{_status:-1,_result:e},_init:d0}};de.memo=function(e,t){return{$$typeof:o0,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=Ie.T,a={};Ie.T=a;try{var r=e(),i=Ie.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Dc,Cm)}catch(n){Cm(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ie.T=t}};de.unstable_useCacheRefresh=function(){return Ie.H.useCacheRefresh()};de.use=function(e){return Ie.H.use(e)};de.useActionState=function(e,t,a){return Ie.H.useActionState(e,t,a)};de.useCallback=function(e,t){return Ie.H.useCallback(e,t)};de.useContext=function(e){return Ie.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return Ie.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return Ie.H.useEffect(e,t)};de.useEffectEvent=function(e){return Ie.H.useEffectEvent(e)};de.useId=function(){return Ie.H.useId()};de.useImperativeHandle=function(e,t,a){return Ie.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return Ie.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return Ie.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return Ie.H.useMemo(e,t)};de.useOptimistic=function(e,t){return Ie.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return Ie.H.useReducer(e,t,a)};de.useRef=function(e){return Ie.H.useRef(e)};de.useState=function(e){return Ie.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return Ie.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return Ie.H.useTransition()};de.version="19.2.3"});var Ye=Ra((_x,Um)=>{"use strict";Um.exports=Rm()});var Om=Ra(Lt=>{"use strict";var f0=Ye();function Dm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vr(){}var Bt={d:{f:vr,r:function(){throw Error(Dm(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},h0=Symbol.for("react.portal");function g0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Jn=f0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function gl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Dm(299));return g0(e,t,null,a)};Lt.flushSync=function(e){var t=Jn.T,a=Bt.p;try{if(Jn.T=null,Bt.p=2,e)return e()}finally{Jn.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=gl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=gl(t.as,t.crossOrigin);Bt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=gl(a,t.crossOrigin);Bt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=gl(t.as,t.crossOrigin);Bt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return Jn.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return Jn.H.useHostTransitionStatus()};Lt.version="19.2.3"});var Hm=Ra((kx,Lm)=>{"use strict";function Bm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bm)}catch(e){console.error(e)}}Bm(),Lm.exports=Om()});var Fb=Ra(Qs=>{"use strict";var wt=xm(),dh=Ye(),b0=Hm();function B(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function mh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function fh(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function hh(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jm(e){if(Bo(e)!==e)throw Error(B(188))}function w0(e){var t=e.alternate;if(!t){if(t=Bo(e),t===null)throw Error(B(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return jm(i),e;if(n===r)return jm(i),t;n=n.sibling}throw Error(B(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(B(189))}}if(a.alternate!==r)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function gh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=gh(e),t!==null)return t;e=e.sibling}return null}var et=Object.assign,v0=Symbol.for("react.element"),bl=Symbol.for("react.transitional.element"),io=Symbol.for("react.portal"),ji=Symbol.for("react.fragment"),bh=Symbol.for("react.strict_mode"),yu=Symbol.for("react.profiler"),wh=Symbol.for("react.consumer"),er=Symbol.for("react.context"),hp=Symbol.for("react.forward_ref"),_u=Symbol.for("react.suspense"),xu=Symbol.for("react.suspense_list"),gp=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),ku=Symbol.for("react.activity"),y0=Symbol.for("react.memo_cache_sentinel"),Qm=Symbol.iterator;function In(e){return e===null||typeof e!="object"?null:(e=Qm&&e[Qm]||e["@@iterator"],typeof e=="function"?e:null)}var _0=Symbol.for("react.client.reference");function Nu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ji:return"Fragment";case yu:return"Profiler";case bh:return"StrictMode";case _u:return"Suspense";case xu:return"SuspenseList";case ku:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case io:return"Portal";case er:return e.displayName||"Context";case wh:return(e._context.displayName||"Context")+".Consumer";case hp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gp:return t=e.displayName||null,t!==null?t:Nu(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return Nu(e(t))}catch{}}return null}var no=Array.isArray,le=dh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Oe=b0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Su=[],Qi=-1;function Ha(e){return{current:e}}function Nt(e){0>Qi||(e.current=Su[Qi],Su[Qi]=null,Qi--)}function Je(e,t){Qi++,Su[Qi]=e.current,e.current=t}var La=Ha(null),ko=Ha(null),zr=Ha(null),Jl=Ha(null);function Il(e,t){switch(Je(zr,t),Je(ko,e),Je(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pf(t),e=Lb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Nt(La),Je(La,e)}function on(){Nt(La),Nt(ko),Nt(zr)}function Cu(e){e.memoizedState!==null&&Je(Jl,e);var t=La.current,a=Lb(t,e.type);t!==a&&(Je(ko,e),Je(La,a))}function Fl(e){ko.current===e&&(Nt(La),Nt(ko)),Jl.current===e&&(Nt(Jl),Uo._currentValue=ai)}var Qc,Gm;function Fr(e){if(Qc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qc=t&&t[1]||"",Gm=-1<a.stack.indexOf(`
1
+ import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var Cm=Ra(tt=>{"use strict";function Rc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<ml(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function hl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>ml(l,a))c<i&&0>ml(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>ml(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function ml(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}tt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(bm=performance,tt.unstable_now=function(){return bm.now()}):(Tc=Date,wm=Tc.now(),tt.unstable_now=function(){return Tc.now()-wm});var bm,Tc,wm,$a=[],wr=[],o0=1,pa=null,Dt=3,Uc=!1,Kn=!1,Pn=!1,Dc=!1,_m=typeof setTimeout=="function"?setTimeout:null,xm=typeof clearTimeout=="function"?clearTimeout:null,vm=typeof setImmediate<"u"?setImmediate:null;function fl(e){for(var t=Ua(wr);t!==null;){if(t.callback===null)hl(wr);else if(t.startTime<=e)hl(wr),t.sortIndex=t.expirationTime,Rc($a,t);else break;t=Ua(wr)}}function Oc(e){if(Pn=!1,fl(e),!Kn)if(Ua($a)!==null)Kn=!0,Ai||(Ai=!0,zi());else{var t=Ua(wr);t!==null&&Bc(Oc,t.startTime-e)}}var Ai=!1,Jn=-1,km=5,Nm=-1;function Sm(){return Dc?!0:!(tt.unstable_now()-Nm<km)}function zc(){if(Dc=!1,Ai){var e=tt.unstable_now();Nm=e;var t=!0;try{e:{Kn=!1,Pn&&(Pn=!1,xm(Jn),Jn=-1),Uc=!0;var a=Dt;try{t:{for(fl(e),pa=Ua($a);pa!==null&&!(pa.expirationTime>e&&Sm());){var r=pa.callback;if(typeof r=="function"){pa.callback=null,Dt=pa.priorityLevel;var i=r(pa.expirationTime<=e);if(e=tt.unstable_now(),typeof i=="function"){pa.callback=i,fl(e),t=!0;break t}pa===Ua($a)&&hl($a),fl(e)}else hl($a);pa=Ua($a)}if(pa!==null)t=!0;else{var n=Ua(wr);n!==null&&Bc(Oc,n.startTime-e),t=!1}}break e}finally{pa=null,Dt=a,Uc=!1}t=void 0}}finally{t?zi():Ai=!1}}}var zi;typeof vm=="function"?zi=function(){vm(zc)}:typeof MessageChannel<"u"?(Ac=new MessageChannel,ym=Ac.port2,Ac.port1.onmessage=zc,zi=function(){ym.postMessage(null)}):zi=function(){_m(zc,0)};var Ac,ym;function Bc(e,t){Jn=_m(function(){e(tt.unstable_now())},t)}tt.unstable_IdlePriority=5;tt.unstable_ImmediatePriority=1;tt.unstable_LowPriority=4;tt.unstable_NormalPriority=3;tt.unstable_Profiling=null;tt.unstable_UserBlockingPriority=2;tt.unstable_cancelCallback=function(e){e.callback=null};tt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):km=0<e?Math.floor(1e3/e):5};tt.unstable_getCurrentPriorityLevel=function(){return Dt};tt.unstable_next=function(e){switch(Dt){case 1:case 2:case 3:var t=3;break;default:t=Dt}var a=Dt;Dt=t;try{return e()}finally{Dt=a}};tt.unstable_requestPaint=function(){Dc=!0};tt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Dt;Dt=e;try{return t()}finally{Dt=a}};tt.unstable_scheduleCallback=function(e,t,a){var r=tt.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:o0++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Rc(wr,e),Ua($a)===null&&e===Ua(wr)&&(Pn?(xm(Jn),Jn=-1):Pn=!0,Bc(Oc,a-r))):(e.sortIndex=i,Rc($a,e),Kn||Uc||(Kn=!0,Ai||(Ai=!0,zi()))),e};tt.unstable_shouldYield=Sm;tt.unstable_wrapCallback=function(e){var t=Dt;return function(){var a=Dt;Dt=t;try{return e.apply(this,arguments)}finally{Dt=a}}}});var Em=Ra((Tx,qm)=>{"use strict";qm.exports=Cm()});var Hm=Ra(de=>{"use strict";var jc=Symbol.for("react.transitional.element"),l0=Symbol.for("react.portal"),s0=Symbol.for("react.fragment"),c0=Symbol.for("react.strict_mode"),u0=Symbol.for("react.profiler"),p0=Symbol.for("react.consumer"),d0=Symbol.for("react.context"),m0=Symbol.for("react.forward_ref"),f0=Symbol.for("react.suspense"),h0=Symbol.for("react.memo"),Rm=Symbol.for("react.lazy"),g0=Symbol.for("react.activity"),Mm=Symbol.iterator;function b0(e){return e===null||typeof e!="object"?null:(e=Mm&&e[Mm]||e["@@iterator"],typeof e=="function"?e:null)}var Um={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dm=Object.assign,Om={};function Ui(e,t,a){this.props=e,this.context=t,this.refs=Om,this.updater=a||Um}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bm(){}Bm.prototype=Ui.prototype;function Qc(e,t,a){this.props=e,this.context=t,this.refs=Om,this.updater=a||Um}var Gc=Qc.prototype=new Bm;Gc.constructor=Qc;Dm(Gc,Ui.prototype);Gc.isPureReactComponent=!0;var Tm=Array.isArray;function Hc(){}var Ie={H:null,A:null,T:null,S:null},Lm=Object.prototype.hasOwnProperty;function Yc(e,t,a){var r=a.ref;return{$$typeof:jc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function w0(e,t){return Yc(e.type,t,e.props)}function Xc(e){return typeof e=="object"&&e!==null&&e.$$typeof===jc}function v0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var zm=/\/+/g;function Lc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?v0(""+e.key):t.toString(36)}function y0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Hc,Hc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ri(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case jc:case l0:o=!0;break;case Rm:return o=e._init,Ri(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+Lc(e,0):r,Tm(i)?(a="",o!=null&&(a=o.replace(zm,"$&/")+"/"),Ri(i,t,a,"",function(p){return p})):i!=null&&(Xc(i)&&(i=w0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(zm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(Tm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+Lc(r,c),o+=Ri(r,t,a,n,i);else if(c=b0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+Lc(r,c++),o+=Ri(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Ri(y0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function gl(e,t,a){if(e==null)return e;var r=[],i=0;return Ri(e,r,"","",function(n){return t.call(a,n,i++)}),r}function _0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Am=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},x0={map:gl,forEach:function(e,t,a){gl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return gl(e,function(){t++}),t},toArray:function(e){return gl(e,function(t){return t})||[]},only:function(e){if(!Xc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=g0;de.Children=x0;de.Component=Ui;de.Fragment=s0;de.Profiler=u0;de.PureComponent=Qc;de.StrictMode=c0;de.Suspense=f0;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ie;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ie.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Dm({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Lm.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Yc(e.type,i,r)};de.createContext=function(e){return e={$$typeof:d0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:p0,_context:e},e};de.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Lm.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Yc(e,n,i)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:m0,render:e}};de.isValidElement=Xc;de.lazy=function(e){return{$$typeof:Rm,_payload:{_status:-1,_result:e},_init:_0}};de.memo=function(e,t){return{$$typeof:h0,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=Ie.T,a={};Ie.T=a;try{var r=e(),i=Ie.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Hc,Am)}catch(n){Am(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ie.T=t}};de.unstable_useCacheRefresh=function(){return Ie.H.useCacheRefresh()};de.use=function(e){return Ie.H.use(e)};de.useActionState=function(e,t,a){return Ie.H.useActionState(e,t,a)};de.useCallback=function(e,t){return Ie.H.useCallback(e,t)};de.useContext=function(e){return Ie.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return Ie.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return Ie.H.useEffect(e,t)};de.useEffectEvent=function(e){return Ie.H.useEffectEvent(e)};de.useId=function(){return Ie.H.useId()};de.useImperativeHandle=function(e,t,a){return Ie.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return Ie.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return Ie.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return Ie.H.useMemo(e,t)};de.useOptimistic=function(e,t){return Ie.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return Ie.H.useReducer(e,t,a)};de.useRef=function(e){return Ie.H.useRef(e)};de.useState=function(e){return Ie.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return Ie.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return Ie.H.useTransition()};de.version="19.2.3"});var Ge=Ra((Ax,jm)=>{"use strict";jm.exports=Hm()});var Gm=Ra(Lt=>{"use strict";var k0=Ge();function Qm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vr(){}var Bt={d:{f:vr,r:function(){throw Error(Qm(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},N0=Symbol.for("react.portal");function S0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var In=k0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function bl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Qm(299));return S0(e,t,null,a)};Lt.flushSync=function(e){var t=In.T,a=Bt.p;try{if(In.T=null,Bt.p=2,e)return e()}finally{In.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=bl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=bl(t.as,t.crossOrigin);Bt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=bl(a,t.crossOrigin);Bt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=bl(t.as,t.crossOrigin);Bt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return In.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return In.H.useHostTransitionStatus()};Lt.version="19.2.3"});var Vm=Ra((Ux,Xm)=>{"use strict";function Ym(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ym)}catch(e){console.error(e)}}Ym(),Xm.exports=Gm()});var iw=Ra(Gs=>{"use strict";var wt=Em(),wh=Ge(),C0=Vm();function O(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Lo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function yh(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $m(e){if(Lo(e)!==e)throw Error(O(188))}function q0(e){var t=e.alternate;if(!t){if(t=Lo(e),t===null)throw Error(O(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return $m(i),e;if(n===r)return $m(i),t;n=n.sibling}throw Error(O(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(O(189))}}if(a.alternate!==r)throw Error(O(190))}if(a.tag!==3)throw Error(O(188));return a.stateNode.current===a?e:t}function xh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=xh(e),t!==null)return t;e=e.sibling}return null}var et=Object.assign,E0=Symbol.for("react.element"),wl=Symbol.for("react.transitional.element"),no=Symbol.for("react.portal"),ji=Symbol.for("react.fragment"),kh=Symbol.for("react.strict_mode"),Nu=Symbol.for("react.profiler"),Nh=Symbol.for("react.consumer"),er=Symbol.for("react.context"),vp=Symbol.for("react.forward_ref"),Su=Symbol.for("react.suspense"),Cu=Symbol.for("react.suspense_list"),yp=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),qu=Symbol.for("react.activity"),M0=Symbol.for("react.memo_cache_sentinel"),Zm=Symbol.iterator;function Fn(e){return e===null||typeof e!="object"?null:(e=Zm&&e[Zm]||e["@@iterator"],typeof e=="function"?e:null)}var T0=Symbol.for("react.client.reference");function Eu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===T0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ji:return"Fragment";case Nu:return"Profiler";case kh:return"StrictMode";case Su:return"Suspense";case Cu:return"SuspenseList";case qu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case no:return"Portal";case er:return e.displayName||"Context";case Nh:return(e._context.displayName||"Context")+".Consumer";case vp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yp:return t=e.displayName||null,t!==null?t:Eu(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return Eu(e(t))}catch{}}return null}var oo=Array.isArray,le=wh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De=C0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Mu=[],Qi=-1;function Ha(e){return{current:e}}function kt(e){0>Qi||(e.current=Mu[Qi],Mu[Qi]=null,Qi--)}function Je(e,t){Qi++,Mu[Qi]=e.current,e.current=t}var La=Ha(null),No=Ha(null),zr=Ha(null),Il=Ha(null);function Fl(e,t){switch(Je(zr,t),Je(No,e),Je(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?th(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=th(t),e=Xb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}kt(La),Je(La,e)}function on(){kt(La),kt(No),kt(zr)}function Tu(e){e.memoizedState!==null&&Je(Il,e);var t=La.current,a=Xb(t,e.type);t!==a&&(Je(No,e),Je(La,a))}function Wl(e){No.current===e&&(kt(La),kt(No)),Il.current===e&&(kt(Il),Do._currentValue=ai)}var Vc,Km;function Fr(e){if(Vc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Vc=t&&t[1]||"",Km=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Qc+e+Gm}var Gc=!1;function Yc(e,t){if(!e||Gc)return"";Gc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var g=function(){throw Error()};if(Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(b){var m=b}Reflect.construct(e,[],g)}else{try{g.call()}catch(b){m=b}e.call(g.prototype)}}else{try{throw Error()}catch(b){m=b}(g=e())&&typeof g.catch=="function"&&g.catch(function(){})}}catch(b){if(b&&m&&typeof b.stack=="string")return[b.stack,m.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=r.DetermineComponentFrameRoot(),o=n[0],l=n[1];if(o&&l){var c=o.split(`
3
+ `+Vc+e+Km}var $c=!1;function Zc(e,t){if(!e||$c)return"";$c=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var g=function(){throw Error()};if(Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(b){var m=b}Reflect.construct(e,[],g)}else{try{g.call()}catch(b){m=b}e.call(g.prototype)}}else{try{throw Error()}catch(b){m=b}(g=e())&&typeof g.catch=="function"&&g.catch(function(){})}}catch(b){if(b&&m&&typeof b.stack=="string")return[b.stack,m.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=r.DetermineComponentFrameRoot(),o=n[0],l=n[1];if(o&&l){var c=o.split(`
4
4
  `),p=l.split(`
5
5
  `);for(i=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;i<p.length&&!p[i].includes("DetermineComponentFrameRoot");)i++;if(r===c.length||i===p.length)for(r=c.length-1,i=p.length-1;1<=r&&0<=i&&c[r]!==p[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==p[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==p[i]){var d=`
6
- `+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=i);break}}}finally{Gc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function x0(e,t){switch(e.tag){case 26:case 27:case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return e.child!==t&&t!==null?Fr("Suspense Fallback"):Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 15:return Yc(e.type,!1);case 11:return Yc(e.type.render,!1);case 1:return Yc(e.type,!0);case 31:return Fr("Activity");default:return""}}function Ym(e){try{var t="",a=null;do t+=x0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
6
+ `+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=i);break}}}finally{$c=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function z0(e,t){switch(e.tag){case 26:case 27:case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return e.child!==t&&t!==null?Fr("Suspense Fallback"):Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 15:return Zc(e.type,!1);case 11:return Zc(e.type.render,!1);case 1:return Zc(e.type,!0);case 31:return Fr("Activity");default:return""}}function Pm(e){try{var t="",a=null;do t+=z0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
7
  Error generating stack: `+r.message+`
8
- `+r.stack}}var qu=Object.prototype.hasOwnProperty,bp=wt.unstable_scheduleCallback,Xc=wt.unstable_cancelCallback,k0=wt.unstable_shouldYield,N0=wt.unstable_requestPaint,na=wt.unstable_now,S0=wt.unstable_getCurrentPriorityLevel,vh=wt.unstable_ImmediatePriority,yh=wt.unstable_UserBlockingPriority,Wl=wt.unstable_NormalPriority,C0=wt.unstable_LowPriority,_h=wt.unstable_IdlePriority,q0=wt.log,E0=wt.unstable_setDisableYieldValue,Lo=null,oa=null;function Cr(e){if(typeof q0=="function"&&E0(e),oa&&typeof oa.setStrictMode=="function")try{oa.setStrictMode(Lo,e)}catch{}}var la=Math.clz32?Math.clz32:z0,M0=Math.log,T0=Math.LN2;function z0(e){return e>>>=0,e===0?32:31-(M0(e)/T0|0)|0}var wl=256,vl=262144,yl=4194304;function Wr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ss(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=Wr(r):(o&=l,o!==0?i=Wr(o):a||(a=l&~e,a!==0&&(i=Wr(a))))):(l=r&~n,l!==0?i=Wr(l):o!==0?i=Wr(o):a||(a=r&~e,a!==0&&(i=Wr(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Ho(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function A0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xh(){var e=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),e}function Vc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function jo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function R0(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var d=31-la(a),g=1<<d;l[d]=0,c[d]=-1;var m=p[d];if(m!==null)for(p[d]=null,d=0;d<m.length;d++){var b=m[d];b!==null&&(b.lane&=-536870913)}a&=~g}r!==0&&kh(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function kh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-la(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Nh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-la(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function Sh(e,t){var a=t&-t;return a=(a&42)!==0?1:wp(a),(a&(e.suspendedLanes|t))!==0?0:a}function wp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ch(){var e=Oe.p;return e!==0?e:(e=window.event,e===void 0?32:Pb(e.type))}function Xm(e,t){var a=Oe.p;try{return Oe.p=e,t()}finally{Oe.p=a}}var Xr=Math.random().toString(36).slice(2),Et="__reactFiber$"+Xr,Pt="__reactProps$"+Xr,bn="__reactContainer$"+Xr,Eu="__reactEvents$"+Xr,U0="__reactListeners$"+Xr,D0="__reactHandles$"+Xr,Vm="__reactResources$"+Xr,Qo="__reactMarker$"+Xr;function yp(e){delete e[Et],delete e[Pt],delete e[Eu],delete e[U0],delete e[D0]}function Gi(e){var t=e[Et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[Et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=eh(e);e!==null;){if(a=e[Et])return a;e=eh(e)}return t}e=a,a=e.parentNode}return null}function wn(e){if(e=e[Et]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Fi(e){var t=e[Vm];return t||(t=e[Vm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Qo]=!0}var qh=new Set,Eh={};function di(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(Eh[e]=t,e=0;e<t.length;e++)qh.add(t[e])}var O0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$m={},Zm={};function B0(e){return qu.call(Zm,e)?!0:qu.call($m,e)?!1:O0.test(e)?Zm[e]=!0:($m[e]=!0,!1)}function Dl(e,t,a){if(B0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function _l(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Za(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ma(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mu(e){if(!e._valueTracker){var t=Mh(e)?"checked":"value";e._valueTracker=L0(e,t,""+e[t])}}function Th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Mh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function es(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var H0=/[\n"\\]/g;function ga(e){return e.replace(H0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ma(t)):e.value!==""+ma(t)&&(e.value=""+ma(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?zu(e,o,ma(t)):a!=null?zu(e,o,ma(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function zh(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Mu(e);return}a=a!=null?""+ma(a):"",t=t!=null?""+ma(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Mu(e)}function zu(e,t,a){t==="number"&&es(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Wi(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ah(e,t,a){if(t!=null&&(t=""+ma(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ma(a):""}function Rh(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(B(92));if(no(r)){if(1<r.length)throw Error(B(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ma(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Mu(e)}function sn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var j0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Km(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||j0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Uh(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&Km(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&Km(e,n,t[n])}function _p(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Q0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),G0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ol(e){return G0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tr(){}var Au=null;function xp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,en=null;function Pm(e){var t=wn(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Tu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ga(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[Pt]||null;if(!i)throw Error(B(90));Tu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Th(r)}break e;case"textarea":Ah(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Wi(e,!!a.multiple,t,!1)}}}var $c=!1;function Dh(e,t,a){if($c)return e(t,a);$c=!0;try{var r=e(t);return r}finally{if($c=!1,(Yi!==null||en!==null)&&(Bs(),Yi&&(t=Yi,e=en,en=Yi=null,Pm(t),e)))for(t=0;t<e.length;t++)Pm(e[t])}}function No(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(B(231,t,typeof a));return a}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ru=!1;if(or)try{Di={},Object.defineProperty(Di,"passive",{get:function(){Ru=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Ru=!1}var Di,qr=null,kp=null,Bl=null;function Oh(){if(Bl)return Bl;var e,t=kp,a=t.length,r,i="value"in qr?qr.value:qr.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return Bl=i.slice(e,1<r?1-r:void 0)}function Ll(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xl(){return!0}function Jm(){return!1}function Jt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?xl:Jm,this.isPropagationStopped=Jm,this}return et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=xl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=xl)},persist:function(){},isPersistent:xl}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cs=Jt(mi),Go=et({},mi,{view:0,detail:0}),Y0=Jt(Go),Zc,Kc,Fn,qs=et({},Go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Np,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fn&&(Fn&&e.type==="mousemove"?(Zc=e.screenX-Fn.screenX,Kc=e.screenY-Fn.screenY):Kc=Zc=0,Fn=e),Zc)},movementY:function(e){return"movementY"in e?e.movementY:Kc}}),Im=Jt(qs),X0=et({},qs,{dataTransfer:0}),V0=Jt(X0),$0=et({},Go,{relatedTarget:0}),Pc=Jt($0),Z0=et({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),K0=Jt(Z0),P0=et({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),J0=Jt(P0),I0=et({},mi,{data:0}),Fm=Jt(I0),F0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ey={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ty(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ey[e])?!!t[e]:!1}function Np(){return ty}var ay=et({},Go,{key:function(e){if(e.key){var t=F0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ll(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?W0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Np,charCode:function(e){return e.type==="keypress"?Ll(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ll(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ry=Jt(ay),iy=et({},qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wm=Jt(iy),ny=et({},Go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Np}),oy=Jt(ny),ly=et({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),sy=Jt(ly),cy=et({},qs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),uy=Jt(cy),py=et({},mi,{newState:0,oldState:0}),dy=Jt(py),my=[9,13,27,32],Sp=or&&"CompositionEvent"in window,co=null;or&&"documentMode"in document&&(co=document.documentMode);var fy=or&&"TextEvent"in window&&!co,Bh=or&&(!Sp||co&&8<co&&11>=co),ef=" ",tf=!1;function Lh(e,t){switch(e){case"keyup":return my.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function hy(e,t){switch(e){case"compositionend":return Hh(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function gy(e,t){if(Xi)return e==="compositionend"||!Sp&&Lh(e,t)?(e=Oh(),Bl=kp=qr=null,Xi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bh&&t.locale!=="ko"?null:t.data;default:return null}}var by={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!by[e.type]:t==="textarea"}function jh(e,t,a,r){Yi?en?en.push(r):en=[r]:Yi=r,t=ws(t,"onChange"),0<t.length&&(a=new Cs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var uo=null,So=null;function wy(e){Db(e,0)}function Es(e){var t=oo(e);if(Th(t))return e}function rf(e,t){if(e==="change")return t}var Qh=!1;or&&(or?(Nl="oninput"in document,Nl||(Jc=document.createElement("div"),Jc.setAttribute("oninput","return;"),Nl=typeof Jc.oninput=="function"),kl=Nl):kl=!1,Qh=kl&&(!document.documentMode||9<document.documentMode));var kl,Nl,Jc;function nf(){uo&&(uo.detachEvent("onpropertychange",Gh),So=uo=null)}function Gh(e){if(e.propertyName==="value"&&Es(So)){var t=[];jh(t,So,e,xp(e)),Dh(wy,t)}}function vy(e,t,a){e==="focusin"?(nf(),uo=t,So=a,uo.attachEvent("onpropertychange",Gh)):e==="focusout"&&nf()}function yy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(So)}function _y(e,t){if(e==="click")return Es(t)}function xy(e,t){if(e==="input"||e==="change")return Es(t)}function ky(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ca=typeof Object.is=="function"?Object.is:ky;function Co(e,t){if(ca(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!qu.call(t,i)||!ca(e[i],t[i]))return!1}return!0}function of(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lf(e,t){var a=of(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=of(a)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=es(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=es(e.document)}return t}function Cp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ny=or&&"documentMode"in document&&11>=document.documentMode,Vi=null,Uu=null,po=null,Du=!1;function sf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Du||Vi==null||Vi!==es(r)||(r=Vi,"selectionStart"in r&&Cp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),po&&Co(po,r)||(po=r,r=ws(Uu,"onSelect"),0<r.length&&(t=new Cs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Vi)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},Ic={},Vh={};or&&(Vh=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function fi(e){if(Ic[e])return Ic[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Vh)return Ic[e]=t[a];return e}var $h=fi("animationend"),Zh=fi("animationiteration"),Kh=fi("animationstart"),Sy=fi("transitionrun"),Cy=fi("transitionstart"),qy=fi("transitioncancel"),Ph=fi("transitionend"),Jh=new Map,Ou="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ou.push("scrollEnd");function Ta(e,t){Jh.set(e,t),di(t,[e])}var ts=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},da=[],Zi=0,qp=0;function Ms(){for(var e=Zi,t=qp=Zi=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var i=da[t];da[t++]=null;var n=da[t];if(da[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&Ih(a,i,n)}}function Ts(e,t,a,r){da[Zi++]=e,da[Zi++]=t,da[Zi++]=a,da[Zi++]=r,qp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ep(e,t,a,r){return Ts(e,t,a,r),as(e)}function hi(e,t){return Ts(e,null,null,t),as(e)}function Ih(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-la(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function as(e){if(50<_o)throw _o=0,rp=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function Ey(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,a,r){return new Ey(e,t,a,r)}function Mp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rr(e,t){var a=e.alternate;return a===null?(a=ra(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Fh(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Mp(e)&&(o=1);else if(typeof e=="string")o=z1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ku:return e=ra(31,a,t,i),e.elementType=ku,e.lanes=n,e;case ji:return ri(a.children,i,n,t);case bh:o=8,i|=24;break;case yu:return e=ra(12,a,t,i|2),e.elementType=yu,e.lanes=n,e;case _u:return e=ra(13,a,t,i),e.elementType=_u,e.lanes=n,e;case xu:return e=ra(19,a,t,i),e.elementType=xu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case er:o=10;break e;case wh:o=9;break e;case hp:o=11;break e;case gp:o=14;break e;case yr:o=16,r=null;break e}o=29,a=Error(B(130,e===null?"null":typeof e,"")),r=null}return t=ra(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ri(e,t,a,r){return e=ra(7,e,r,t),e.lanes=a,e}function Fc(e,t,a){return e=ra(6,e,null,t),e.lanes=a,e}function Wh(e){var t=ra(18,null,null,0);return t.stateNode=e,t}function Wc(e,t,a){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var cf=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=cf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ym(t)},cf.set(e,t),t)}return{value:e,source:t,stack:Ym(t)}}var Pi=[],Ji=0,rs=null,qo=0,fa=[],ha=0,jr=null,Da=1,Oa="";function Fa(e,t){Pi[Ji++]=qo,Pi[Ji++]=rs,rs=e,qo=t}function eg(e,t,a){fa[ha++]=Da,fa[ha++]=Oa,fa[ha++]=jr,jr=e;var r=Da;e=Oa;var i=32-la(r)-1;r&=~(1<<i),a+=1;var n=32-la(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Da=1<<32-la(t)+i|a<<i|r,Oa=n+e}else Da=1<<n|a<<i|r,Oa=e}function Tp(e){e.return!==null&&(Fa(e,1),eg(e,1,0))}function zp(e){for(;e===rs;)rs=Pi[--Ji],Pi[Ji]=null,qo=Pi[--Ji],Pi[Ji]=null;for(;e===jr;)jr=fa[--ha],fa[ha]=null,Oa=fa[--ha],fa[ha]=null,Da=fa[--ha],fa[ha]=null}function tg(e,t){fa[ha++]=Da,fa[ha++]=Oa,fa[ha++]=jr,Da=t.id,Oa=t.overflow,jr=e}var Mt=null,We=null,Me=!1,Ar=null,wa=!1,Bu=Error(B(519));function Qr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Eo(ba(t,e)),Bu}function uf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Pt]=r,a){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(a=0;a<Ao.length;a++)Se(Ao[a],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),zh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Rh(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Bb(t.textContent,a)?(r.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),r.onScroll!=null&&Se("scroll",t),r.onScrollEnd!=null&&Se("scrollend",t),r.onClick!=null&&(t.onclick=tr),t=!0):t=!1,t||Qr(e,!0)}function pf(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:Mt=Mt.return}}function Oi(e){if(e!==Mt)return!1;if(!Me)return pf(e),Me=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||sp(e.type,e.memoizedProps)),a=!a),a&&We&&Qr(e),pf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));We=Wf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));We=Wf(e)}else t===27?(t=We,Vr(e.type)?(e=dp,dp=null,We=e):We=t):We=Mt?ya(e.stateNode.nextSibling):null;return!0}function li(){We=Mt=null,Me=!1}function eu(){var e=Ar;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Ar=null),e}function Eo(e){Ar===null?Ar=[e]:Ar.push(e)}var Lu=Ha(null),gi=null,ar=null;function xr(e,t,a){Je(Lu,t._currentValue),t._currentValue=a}function ir(e){e._currentValue=Lu.current,Nt(Lu)}function Hu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function ju(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Hu(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(B(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Hu(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function vn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(B(387));if(o=o.memoizedProps,o!==null){var l=i.type;ca(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===Jl.current){if(o=i.alternate,o===null)throw Error(B(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Uo):e=[Uo])}i=i.return}e!==null&&ju(t,e,a,r),t.flags|=262144}function is(e){for(e=e.firstContext;e!==null;){if(!ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,ar=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return ag(gi,e)}function Sl(e,t){return gi===null&&si(e),ag(e,t)}function ag(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ar===null){if(e===null)throw Error(B(308));ar=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ar=ar.next=t;return a}var My=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ty=wt.unstable_scheduleCallback,zy=wt.unstable_NormalPriority,ft={$$typeof:er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new My,data:new Map,refCount:0}}function Yo(e){e.refCount--,e.refCount===0&&Ty(zy,function(){e.controller.abort()})}var mo=null,Qu=0,cn=0,tn=null;function Ay(e,t){if(mo===null){var a=mo=[];Qu=0,cn=rd(),tn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Qu++,t.then(df,df),t}function df(){if(--Qu===0&&mo!==null){tn!==null&&(tn.status="fulfilled");var e=mo;mo=null,cn=0,tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ry(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var mf=le.S;le.S=function(e,t){gb=na(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ay(e,t),mf!==null&&mf(e,t)};var ii=Ha(null);function Rp(){var e=ii.current;return e!==null?e:$e.pooledCache}function jl(e,t){t===null?Je(ii,ii.current):Je(ii,t.pool)}function rg(){var e=Rp();return e===null?null:{parent:ft._currentValue,pool:e}}var yn=Error(B(460)),Up=Error(B(474)),zs=Error(B(542)),ns={then:function(){}};function ff(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ig(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(tr,tr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gf(e),e;default:if(typeof t.status=="string")t.then(tr,tr);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(B(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gf(e),e}throw ni=t,yn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,yn):a}}var ni=null;function hf(){if(ni===null)throw Error(B(459));var e=ni;return ni=null,e}function gf(e){if(e===yn||e===zs)throw Error(B(483))}var an=null,Mo=0;function Cl(e){var t=Mo;return Mo+=1,an===null&&(an=[]),ig(an,e,t)}function Wn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ql(e,t){throw t.$$typeof===v0?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ng(e){function t(f,u){if(e){var w=f.deletions;w===null?(f.deletions=[u],f.flags|=16):w.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=rr(f,u),f.index=0,f.sibling=null,f}function n(f,u,w){return f.index=w,e?(w=f.alternate,w!==null?(w=w.index,w<u?(f.flags|=67108866,u):w):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,w,v){return u===null||u.tag!==6?(u=Fc(w,f.mode,v),u.return=f,u):(u=i(u,w),u.return=f,u)}function c(f,u,w,v){var S=w.type;return S===ji?d(f,u,w.props.children,v,w.key):u!==null&&(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&ei(S)===u.type)?(u=i(u,w.props),Wn(u,w),u.return=f,u):(u=Hl(w.type,w.key,w.props,null,f.mode,v),Wn(u,w),u.return=f,u)}function p(f,u,w,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==w.containerInfo||u.stateNode.implementation!==w.implementation?(u=Wc(w,f.mode,v),u.return=f,u):(u=i(u,w.children||[]),u.return=f,u)}function d(f,u,w,v,S){return u===null||u.tag!==7?(u=ri(w,f.mode,v,S),u.return=f,u):(u=i(u,w),u.return=f,u)}function g(f,u,w){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Fc(""+u,f.mode,w),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case bl:return w=Hl(u.type,u.key,u.props,null,f.mode,w),Wn(w,u),w.return=f,w;case io:return u=Wc(u,f.mode,w),u.return=f,u;case yr:return u=ei(u),g(f,u,w)}if(no(u)||In(u))return u=ri(u,f.mode,w,null),u.return=f,u;if(typeof u.then=="function")return g(f,Cl(u),w);if(u.$$typeof===er)return g(f,Sl(f,u),w);ql(f,u)}return null}function m(f,u,w,v){var S=u!==null?u.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return S!==null?null:l(f,u,""+w,v);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case bl:return w.key===S?c(f,u,w,v):null;case io:return w.key===S?p(f,u,w,v):null;case yr:return w=ei(w),m(f,u,w,v)}if(no(w)||In(w))return S!==null?null:d(f,u,w,v,null);if(typeof w.then=="function")return m(f,u,Cl(w),v);if(w.$$typeof===er)return m(f,u,Sl(f,w),v);ql(f,w)}return null}function b(f,u,w,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(w)||null,l(u,f,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bl:return f=f.get(v.key===null?w:v.key)||null,c(u,f,v,S);case io:return f=f.get(v.key===null?w:v.key)||null,p(u,f,v,S);case yr:return v=ei(v),b(f,u,w,v,S)}if(no(v)||In(v))return f=f.get(w)||null,d(u,f,v,S,null);if(typeof v.then=="function")return b(f,u,w,Cl(v),S);if(v.$$typeof===er)return b(f,u,w,Sl(u,v),S);ql(u,v)}return null}function y(f,u,w,v){for(var S=null,R=null,z=u,A=u=0,Q=null;z!==null&&A<w.length;A++){z.index>A?(Q=z,z=null):Q=z.sibling;var K=m(f,z,w[A],v);if(K===null){z===null&&(z=Q);break}e&&z&&K.alternate===null&&t(f,z),u=n(K,u,A),R===null?S=K:R.sibling=K,R=K,z=Q}if(A===w.length)return a(f,z),Me&&Fa(f,A),S;if(z===null){for(;A<w.length;A++)z=g(f,w[A],v),z!==null&&(u=n(z,u,A),R===null?S=z:R.sibling=z,R=z);return Me&&Fa(f,A),S}for(z=r(z);A<w.length;A++)Q=b(z,f,A,w[A],v),Q!==null&&(e&&Q.alternate!==null&&z.delete(Q.key===null?A:Q.key),u=n(Q,u,A),R===null?S=Q:R.sibling=Q,R=Q);return e&&z.forEach(function(me){return t(f,me)}),Me&&Fa(f,A),S}function T(f,u,w,v){if(w==null)throw Error(B(151));for(var S=null,R=null,z=u,A=u=0,Q=null,K=w.next();z!==null&&!K.done;A++,K=w.next()){z.index>A?(Q=z,z=null):Q=z.sibling;var me=m(f,z,K.value,v);if(me===null){z===null&&(z=Q);break}e&&z&&me.alternate===null&&t(f,z),u=n(me,u,A),R===null?S=me:R.sibling=me,R=me,z=Q}if(K.done)return a(f,z),Me&&Fa(f,A),S;if(z===null){for(;!K.done;A++,K=w.next())K=g(f,K.value,v),K!==null&&(u=n(K,u,A),R===null?S=K:R.sibling=K,R=K);return Me&&Fa(f,A),S}for(z=r(z);!K.done;A++,K=w.next())K=b(z,f,A,K.value,v),K!==null&&(e&&K.alternate!==null&&z.delete(K.key===null?A:K.key),u=n(K,u,A),R===null?S=K:R.sibling=K,R=K);return e&&z.forEach(function(Ue){return t(f,Ue)}),Me&&Fa(f,A),S}function D(f,u,w,v){if(typeof w=="object"&&w!==null&&w.type===ji&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case bl:e:{for(var S=w.key;u!==null;){if(u.key===S){if(S=w.type,S===ji){if(u.tag===7){a(f,u.sibling),v=i(u,w.props.children),v.return=f,f=v;break e}}else if(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&ei(S)===u.type){a(f,u.sibling),v=i(u,w.props),Wn(v,w),v.return=f,f=v;break e}a(f,u);break}else t(f,u);u=u.sibling}w.type===ji?(v=ri(w.props.children,f.mode,v,w.key),v.return=f,f=v):(v=Hl(w.type,w.key,w.props,null,f.mode,v),Wn(v,w),v.return=f,f=v)}return o(f);case io:e:{for(S=w.key;u!==null;){if(u.key===S)if(u.tag===4&&u.stateNode.containerInfo===w.containerInfo&&u.stateNode.implementation===w.implementation){a(f,u.sibling),v=i(u,w.children||[]),v.return=f,f=v;break e}else{a(f,u);break}else t(f,u);u=u.sibling}v=Wc(w,f.mode,v),v.return=f,f=v}return o(f);case yr:return w=ei(w),D(f,u,w,v)}if(no(w))return y(f,u,w,v);if(In(w)){if(S=In(w),typeof S!="function")throw Error(B(150));return w=S.call(w),T(f,u,w,v)}if(typeof w.then=="function")return D(f,u,Cl(w),v);if(w.$$typeof===er)return D(f,u,Sl(f,w),v);ql(f,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,u!==null&&u.tag===6?(a(f,u.sibling),v=i(u,w),v.return=f,f=v):(a(f,u),v=Fc(w,f.mode,v),v.return=f,f=v),o(f)):a(f,u)}return function(f,u,w,v){try{Mo=0;var S=D(f,u,w,v);return an=null,S}catch(z){if(z===yn||z===zs)throw z;var R=ra(29,z,null,f.mode);return R.lanes=v,R.return=f,R}}}var ci=ng(!0),og=ng(!1),_r=!1;function Dp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ur(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(De&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=as(e),Ih(e,null,a),t}return Ts(e,r,t,a),as(e)}function fo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Nh(e,a)}}function tu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Yu=!1;function ho(){if(Yu){var e=tn;if(e!==null)throw e}}function go(e,t,a,r){Yu=!1;var i=e.updateQueue;_r=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=p:l.next=p,d.lastBaseUpdate=c))}if(n!==null){var g=i.baseState;o=0,d=p=c=null,l=n;do{var m=l.lane&-536870913,b=m!==l.lane;if(b?(qe&m)===m:(r&m)===m){m!==0&&m===cn&&(Yu=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var y=e,T=l;m=t;var D=a;switch(T.tag){case 1:if(y=T.payload,typeof y=="function"){g=y.call(D,g,m);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=T.payload,m=typeof y=="function"?y.call(D,g,m):y,m==null)break e;g=et({},g,m);break e;case 2:_r=!0}}m=l.callback,m!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[m]:b.push(m))}else b={lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(p=d=b,c=g):d=d.next=b,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);d===null&&(c=g),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=d,n===null&&(i.shared.lanes=0),Yr|=o,e.lanes=o,e.memoizedState=g}}function lg(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function sg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)lg(a[e],t)}var un=Ha(null),os=Ha(0);function bf(e,t){e=ur,Je(os,e),Je(un,t),ur=e|t.baseLanes}function Xu(){Je(os,ur),Je(un,un.current)}function Op(){ur=os.current,Nt(un),Nt(os)}var ua=Ha(null),va=null;function kr(e){var t=e.alternate;Je(st,st.current&1),Je(ua,e),va===null&&(t===null||un.current!==null||t.memoizedState!==null)&&(va=e)}function Vu(e){Je(st,st.current),Je(ua,e),va===null&&(va=e)}function cg(e){e.tag===22?(Je(st,st.current),Je(ua,e),va===null&&(va=e)):Nr(e)}function Nr(){Je(st,st.current),Je(ua,ua.current)}function aa(e){Nt(ua),va===e&&(va=null),Nt(st)}var st=Ha(0);function ls(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||up(a)||pp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lr=0,fe=null,Ve=null,dt=null,ss=!1,rn=!1,ui=!1,cs=0,To=0,nn=null,Uy=0;function it(){throw Error(B(321))}function Bp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ca(e[a],t[a]))return!1;return!0}function Lp(e,t,a,r,i,n){return lr=n,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,le.H=e===null||e.memoizedState===null?jg:Pp,ui=!1,n=a(r,i),ui=!1,rn&&(n=pg(t,a,r,i)),ug(e),n}function ug(e){le.H=zo;var t=Ve!==null&&Ve.next!==null;if(lr=0,dt=Ve=fe=null,ss=!1,To=0,nn=null,t)throw Error(B(300));e===null||ht||(e=e.dependencies,e!==null&&is(e)&&(ht=!0))}function pg(e,t,a,r){fe=e;var i=0;do{if(rn&&(nn=null),To=0,rn=!1,25<=i)throw Error(B(301));if(i+=1,dt=Ve=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}le.H=Qg,n=t(a,r)}while(rn);return n}function Dy(){var e=le.H,t=e.useState()[0];return t=typeof t.then=="function"?Xo(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(fe.flags|=1024),t}function Hp(){var e=cs!==0;return cs=0,e}function jp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Qp(e){if(ss){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ss=!1}lr=0,dt=Ve=fe=null,rn=!1,To=cs=0,nn=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?fe.memoizedState=dt=e:dt=dt.next=e,dt}function ct(){if(Ve===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=dt===null?fe.memoizedState:dt.next;if(t!==null)dt=t,Ve=e;else{if(e===null)throw fe.alternate===null?Error(B(467)):Error(B(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},dt===null?fe.memoizedState=dt=e:dt=dt.next=e}return dt}function As(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xo(e){var t=To;return To+=1,nn===null&&(nn=[]),e=ig(nn,e,t),t=fe,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,le.H=t===null||t.memoizedState===null?jg:Pp),e}function Rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xo(e);if(e.$$typeof===er)return Tt(e)}throw Error(B(438,String(e)))}function Gp(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=As(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=y0;return t.index++,a}function sr(e,t){return typeof t=="function"?t(e):t}function Ql(e){var t=ct();return Yp(t,Ve,e)}function Yp(e,t,a){var r=e.queue;if(r===null)throw Error(B(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,d=!1;do{var g=p.lane&-536870913;if(g!==p.lane?(qe&g)===g:(lr&g)===g){var m=p.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),g===cn&&(d=!0);else if((lr&m)===m){p=p.next,m===cn&&(d=!0);continue}else g={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=g,o=n):c=c.next=g,fe.lanes|=m,Yr|=m;g=p.action,ui&&a(n,g),n=p.hasEagerState?p.eagerState:a(n,g)}else m={lane:g,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=m,o=n):c=c.next=m,fe.lanes|=g,Yr|=g;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!ca(n,e.memoizedState)&&(ht=!0,d&&(a=tn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function au(e){var t=ct(),a=t.queue;if(a===null)throw Error(B(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);ca(n,t.memoizedState)||(ht=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function dg(e,t,a){var r=fe,i=ct(),n=Me;if(n){if(a===void 0)throw Error(B(407));a=a()}else a=t();var o=!ca((Ve||i).memoizedState,a);if(o&&(i.memoizedState=a,ht=!0),i=i.queue,Xp(hg.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||dt!==null&&dt.memoizedState.tag&1){if(r.flags|=2048,pn(9,{destroy:void 0},fg.bind(null,r,i,a,t),null),$e===null)throw Error(B(349));n||(lr&127)!==0||mg(r,t,a)}return a}function mg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=As(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function fg(e,t,a,r){t.value=a,t.getSnapshot=r,gg(t)&&bg(e)}function hg(e,t,a){return a(function(){gg(t)&&bg(e)})}function gg(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ca(e,a)}catch{return!0}}function bg(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function $u(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Cr(!0);try{a()}finally{Cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:e},t}function wg(e,t,a,r){return e.baseState=a,Yp(e,Ve,typeof r=="function"?r:sr)}function Oy(e,t,a,r,i){if(Ds(e))throw Error(B(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};le.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,vg(t,n)):(n.next=a.next,t.pending=a.next=n)}}function vg(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=le.T,o={};le.T=o;try{var l=a(i,r),c=le.S;c!==null&&c(o,l),wf(e,t,l)}catch(p){Zu(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),le.T=n}}else try{n=a(i,r),wf(e,t,n)}catch(p){Zu(e,t,p)}}function wf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){vf(e,t,r)},function(r){return Zu(e,t,r)}):vf(e,t,a)}function vf(e,t,a){t.status="fulfilled",t.value=a,yg(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,vg(e,a)))}function Zu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,yg(t),t=t.next;while(t!==r)}e.action=null}function yg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _g(e,t){return t}function yf(e,t){if(Me){var a=$e.formState;if(a!==null){e:{var r=fe;if(Me){if(We){t:{for(var i=We,n=wa;i.nodeType!==8;){if(!n){i=null;break t}if(i=ya(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){We=ya(i.nextSibling),r=i.data==="F!";break e}}Qr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_g,lastRenderedState:t},a.queue=r,a=Bg.bind(null,fe,r),r.dispatch=a,r=$u(!1),n=Kp.bind(null,fe,!1,r.queue),r=Ht(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=Oy.bind(null,fe,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function _f(e){var t=ct();return xg(t,Ve,e)}function xg(e,t,a){if(t=Yp(e,t,_g)[0],e=Ql(sr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Xo(t)}catch(o){throw o===yn?zs:o}else r=t;t=ct();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,pn(9,{destroy:void 0},By.bind(null,i,a),null)),[r,n,e]}function By(e,t){e.action=t}function xf(e){var t=ct(),a=Ve;if(a!==null)return xg(t,a,e);ct(),t=t.memoizedState,a=ct();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function pn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=As(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function kg(){return ct().memoizedState}function Gl(e,t,a,r){var i=Ht();fe.flags|=e,i.memoizedState=pn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Us(e,t,a,r){var i=ct();r=r===void 0?null:r;var n=i.memoizedState.inst;Ve!==null&&r!==null&&Bp(r,Ve.memoizedState.deps)?i.memoizedState=pn(t,n,a,r):(fe.flags|=e,i.memoizedState=pn(1|t,n,a,r))}function kf(e,t){Gl(8390656,8,e,t)}function Xp(e,t){Us(2048,8,e,t)}function Ly(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=As(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Ng(e){var t=ct().memoizedState;return Ly({ref:t,nextImpl:e}),function(){if((De&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function Sg(e,t){return Us(4,2,e,t)}function Cg(e,t){return Us(4,4,e,t)}function qg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eg(e,t,a){a=a!=null?a.concat([e]):null,Us(4,4,qg.bind(null,t,e),a)}function Vp(){}function Mg(e,t){var a=ct();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Bp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Tg(e,t){var a=ct();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Bp(t,r[1]))return r[0];if(r=e(),ui){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r}function $p(e,t,a){return a===void 0||(lr&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=wb(),fe.lanes|=e,Yr|=e,a)}function zg(e,t,a,r){return ca(a,t)?a:un.current!==null?(e=$p(e,a,r),ca(e,t)||(ht=!0),e):(lr&42)===0||(lr&1073741824)!==0&&(qe&261930)===0?(ht=!0,e.memoizedState=a):(e=wb(),fe.lanes|=e,Yr|=e,t)}function Ag(e,t,a,r,i){var n=Oe.p;Oe.p=n!==0&&8>n?n:8;var o=le.T,l={};le.T=l,Kp(e,!1,t,a);try{var c=i(),p=le.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=Ry(c,r);bo(e,t,d,sa(e))}else bo(e,t,r,sa(e))}catch(g){bo(e,t,{then:function(){},status:"rejected",reason:g},sa())}finally{Oe.p=n,o!==null&&l.types!==null&&(o.types=l.types),le.T=o}}function Hy(){}function Ku(e,t,a,r){if(e.tag!==5)throw Error(B(476));var i=Rg(e).queue;Ag(e,i,t,ai,a===null?Hy:function(){return Ug(e),a(r)})}function Rg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ug(e){var t=Rg(e);t.next===null&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},sa())}function Zp(){return Tt(Uo)}function Dg(){return ct().memoizedState}function Og(){return ct().memoizedState}function jy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=sa();e=Rr(a);var r=Ur(t,e,a);r!==null&&(Kt(r,t,a),fo(r,t,a)),t={cache:Ap()},e.payload=t;return}t=t.return}}function Qy(e,t,a){var r=sa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Lg(t,a):(a=Ep(e,t,a,r),a!==null&&(Kt(a,e,r),Hg(a,t,r)))}function Bg(e,t,a){var r=sa();bo(e,t,a,r)}function bo(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Lg(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,ca(l,o))return Ts(e,t,i,0),$e===null&&Ms(),!1}catch{}if(a=Ep(e,t,i,r),a!==null)return Kt(a,e,r),Hg(a,t,r),!0}return!1}function Kp(e,t,a,r){if(r={lane:2,revertLane:rd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(B(479))}else t=Ep(e,a,r,2),t!==null&&Kt(t,e,2)}function Ds(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Lg(e,t){rn=ss=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Hg(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Nh(e,a)}}var zo={readContext:Tt,use:Rs,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};zo.useEffectEvent=it;var jg={readContext:Tt,use:Rs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:kf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Gl(4194308,4,qg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Gl(4194308,4,e,t)},useInsertionEffect:function(e,t){Gl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var i=a(t);if(ui){Cr(!0);try{a(t)}finally{Cr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Qy.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=$u(e);var t=e.queue,a=Bg.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Vp,useDeferredValue:function(e,t){var a=Ht();return $p(a,e,t)},useTransition:function(){var e=$u(!1);return e=Ag.bind(null,fe,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,i=Ht();if(Me){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),$e===null)throw Error(B(349));(qe&127)!==0||mg(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,kf(hg.bind(null,r,n,e),[e]),r.flags|=2048,pn(9,{destroy:void 0},fg.bind(null,r,n,a,t),null),a},useId:function(){var e=Ht(),t=$e.identifierPrefix;if(Me){var a=Oa,r=Da;a=(r&~(1<<32-la(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Uy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zp,useFormState:yf,useActionState:yf,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Kp.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Gp,useCacheRefresh:function(){return Ht().memoizedState=jy.bind(null,fe)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((De&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},Pp={readContext:Tt,use:Rs,useCallback:Mg,useContext:Tt,useEffect:Xp,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Tg,useReducer:Ql,useRef:kg,useState:function(){return Ql(sr)},useDebugValue:Vp,useDeferredValue:function(e,t){var a=ct();return zg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=Ql(sr)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:Xo(e),t]},useSyncExternalStore:dg,useId:Dg,useHostTransitionStatus:Zp,useFormState:_f,useActionState:_f,useOptimistic:function(e,t){var a=ct();return wg(a,Ve,e,t)},useMemoCache:Gp,useCacheRefresh:Og};Pp.useEffectEvent=Ng;var Qg={readContext:Tt,use:Rs,useCallback:Mg,useContext:Tt,useEffect:Xp,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Tg,useReducer:au,useRef:kg,useState:function(){return au(sr)},useDebugValue:Vp,useDeferredValue:function(e,t){var a=ct();return Ve===null?$p(a,e,t):zg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=au(sr)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:Xo(e),t]},useSyncExternalStore:dg,useId:Dg,useHostTransitionStatus:Zp,useFormState:xf,useActionState:xf,useOptimistic:function(e,t){var a=ct();return Ve!==null?wg(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Gp,useCacheRefresh:Og};Qg.useEffectEvent=Ng;function ru(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:et({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Pu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.payload=t,a!=null&&(i.callback=a),t=Ur(e,i,r),t!==null&&(Kt(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Ur(e,i,r),t!==null&&(Kt(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=sa(),r=Rr(a);r.tag=2,t!=null&&(r.callback=t),t=Ur(e,r,a),t!==null&&(Kt(t,e,a),fo(t,e,a))}};function Nf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!Co(a,r)||!Co(i,n):!0}function Sf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Pu.enqueueReplaceState(t,t.state,null)}function pi(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=et({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Gg(e){ts(e)}function Yg(e){console.error(e)}function Xg(e){ts(e)}function us(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Cf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Ju(e,t,a){return a=Rr(a),a.tag=3,a.payload={element:null},a.callback=function(){us(e,t)},a}function Vg(e){return e=Rr(e),e.tag=3,e}function $g(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){Cf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Cf(t,a,r),typeof i!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Gy(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&vn(t,a,i,!0),a=ua.current,a!==null){switch(a.tag){case 31:case 13:return va===null?hs():a.alternate===null&&nt===0&&(nt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),fu(e,r,i)),!1;case 22:return a.flags|=65536,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),fu(e,r,i)),!1}throw Error(B(435,a.tag))}return fu(e,r,i),hs(),!1}if(Me)return t=ua.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Bu&&(e=Error(B(422),{cause:r}),Eo(ba(e,a)))):(r!==Bu&&(t=Error(B(423),{cause:r}),Eo(ba(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ba(r,a),i=Ju(e.stateNode,r,i),tu(e,i),nt!==4&&(nt=2)),!1;var n=Error(B(520),{cause:r});if(n=ba(n,a),yo===null?yo=[n]:yo.push(n),nt!==4&&(nt=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=Ju(a.stateNode,r,e),tu(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Dr===null||!Dr.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Vg(i),$g(i,e,a,r),tu(a,i),!1}a=a.return}while(a!==null);return!1}var Jp=Error(B(461)),ht=!1;function qt(e,t,a,r){t.child=e===null?og(t,null,a,r):ci(t,e.child,a,r)}function qf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return si(t),r=Lp(e,t,a,o,n,i),l=Hp(),e!==null&&!ht?(jp(e,t,i),cr(e,t,i)):(Me&&l&&Tp(t),t.flags|=1,qt(e,t,r,i),t.child)}function Ef(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Mp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,Zg(e,t,n,r,i)):(e=Hl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Ip(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:Co,a(o,r)&&e.ref===t.ref)return cr(e,t,i)}return t.flags|=1,e=rr(n,r),e.ref=t.ref,e.return=t,t.child=e}function Zg(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(Co(n,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=n,Ip(e,i))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,cr(e,t,i)}return Iu(e,t,a,r,i)}function Kg(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return Mf(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jl(t,n!==null?n.cachePool:null),n!==null?bf(t,n):Xu(),cg(t);else return r=t.lanes=536870912,Mf(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(jl(t,n.cachePool),bf(t,n),Nr(t),t.memoizedState=null):(e!==null&&jl(t,null),Xu(),Nr(t));return qt(e,t,i,a),t.child}function lo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mf(e,t,a,r,i){var n=Rp();return n=n===null?null:{parent:ft._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&jl(t,null),Xu(),cg(t),e!==null&&vn(e,t,r,!0),t.childLanes=i,null}function Yl(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tf(e,t,a){return ci(t,e.child,null,a),e=Yl(t,t.pendingProps),e.flags|=2,aa(t),t.memoizedState=null,e}function Yy(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Me){if(r.mode==="hidden")return e=Yl(t,r),t.lanes=536870912,lo(null,e);if(Vu(t),(e=We)?(e=jb(e,wa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Wh(e),a.return=t,t.child=a,Mt=t,We=null)):e=null,e===null)throw Qr(t);return t.lanes=536870912,null}return Yl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Vu(t),i)if(t.flags&256)t.flags&=-257,t=Tf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(ht||vn(e,t,a,!1),i=(a&e.childLanes)!==0,ht||i){if(r=$e,r!==null&&(o=Sh(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Kt(r,e,o),Jp;hs(),t=Tf(e,t,a)}else e=n.treeContext,We=ya(o.nextSibling),Mt=t,Me=!0,Ar=null,wa=!1,e!==null&&tg(t,e),t=Yl(t,r),t.flags|=4096;return t}return e=rr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Iu(e,t,a,r,i){return si(t),a=Lp(e,t,a,r,void 0,i),r=Hp(),e!==null&&!ht?(jp(e,t,i),cr(e,t,i)):(Me&&r&&Tp(t),t.flags|=1,qt(e,t,a,i),t.child)}function zf(e,t,a,r,i,n){return si(t),t.updateQueue=null,a=pg(t,r,a,i),ug(e),r=Hp(),e!==null&&!ht?(jp(e,t,n),cr(e,t,n)):(Me&&r&&Tp(t),t.flags|=1,qt(e,t,a,n),t.child)}function Af(e,t,a,r,i){if(si(t),t.stateNode===null){var n=Ki,o=a.contextType;typeof o=="object"&&o!==null&&(n=Tt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Pu,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},Dp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Tt(o):Ki,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(ru(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&Pu.enqueueReplaceState(n,n.state,null),go(t,r,n,i),ho(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=pi(a,l);n.props=c;var p=n.context,d=a.contextType;o=Ki,typeof d=="object"&&d!==null&&(o=Tt(d));var g=a.getDerivedStateFromProps;d=typeof g=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&Sf(t,n,r,o),_r=!1;var m=t.memoizedState;n.state=m,go(t,r,n,i),ho(),p=t.memoizedState,l||m!==p||_r?(typeof g=="function"&&(ru(t,a,g,r),p=t.memoizedState),(c=_r||Nf(t,a,c,r,m,p,o))?(d||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Gu(e,t),o=t.memoizedProps,d=pi(a,o),n.props=d,g=t.pendingProps,m=n.context,p=a.contextType,c=Ki,typeof p=="object"&&p!==null&&(c=Tt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==g||m!==c)&&Sf(t,n,r,c),_r=!1,m=t.memoizedState,n.state=m,go(t,r,n,i),ho();var b=t.memoizedState;o!==g||m!==b||_r||e!==null&&e.dependencies!==null&&is(e.dependencies)?(typeof l=="function"&&(ru(t,a,l,r),b=t.memoizedState),(d=_r||Nf(t,a,d,r,m,b,c)||e!==null&&e.dependencies!==null&&is(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=d):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Xl(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,a,i)):qt(e,t,a,i),t.memoizedState=n.state,e=t.child):e=cr(e,t,i),e}function Rf(e,t,a,r){return li(),t.flags|=256,qt(e,t,a,r),t.child}var iu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nu(e){return{baseLanes:e,cachePool:rg()}}function ou(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ia),e}function Pg(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Me){if(i?kr(t):Nr(t),(e=We)?(e=jb(e,wa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Wh(e),a.return=t,t.child=a,Mt=t,We=null)):e=null,e===null)throw Qr(t);return pp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(Nr(t),i=t.mode,l=ps({mode:"hidden",children:l},i),r=ri(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=nu(a),r.childLanes=ou(e,o,a),t.memoizedState=iu,lo(null,r)):(kr(t),Fu(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(kr(t),t.flags&=-257,t=lu(e,t,a)):t.memoizedState!==null?(Nr(t),t.child=e.child,t.flags|=128,t=null):(Nr(t),l=r.fallback,i=t.mode,r=ps({mode:"visible",children:r.children},i),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=nu(a),r.childLanes=ou(e,o,a),t.memoizedState=iu,t=lo(null,r));else if(kr(t),pp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(B(419)),r.stack="",r.digest=o,Eo({value:r,source:null,stack:null}),t=lu(e,t,a)}else if(ht||vn(e,t,a,!1),o=(a&e.childLanes)!==0,ht||o){if(o=$e,o!==null&&(r=Sh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),Jp;up(l)||hs(),t=lu(e,t,a)}else up(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,We=ya(l.nextSibling),Mt=t,Me=!0,Ar=null,wa=!1,e!==null&&tg(t,e),t=Fu(t,r.children),t.flags|=4096);return t}return i?(Nr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=rr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=rr(p,l):(l=ri(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,lo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=nu(a):(i=l.cachePool,i!==null?(c=ft._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=rg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=ou(e,o,a),t.memoizedState=iu,lo(e.child,r)):(kr(t),a=e.child,e=a.sibling,a=rr(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Fu(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=ra(22,e,null,t),e.lanes=0,e}function lu(e,t,a){return ci(t,e.child,null,a),e=Fu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hu(e.return,t,a)}function su(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function Jg(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=st.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Je(st,o),qt(e,t,r,a),r=Me?qo:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uf(e,a,t);else if(e.tag===19)Uf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ls(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),su(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ls(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}su(t,!0,a,null,n,r);break;case"together":su(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function cr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(vn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=rr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=rr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Ip(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&is(e)))}function Xy(e,t,a){switch(t.tag){case 3:Il(t,t.stateNode.containerInfo),xr(t,ft,e.memoizedState.cache),li();break;case 27:case 5:Cu(t);break;case 4:Il(t,t.stateNode.containerInfo);break;case 10:xr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(kr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Pg(e,t,a):(kr(t),e=cr(e,t,a),e!==null?e.sibling:null);kr(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(vn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return Jg(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(st,st.current),r)break;return null;case 22:return t.lanes=0,Kg(e,t,a,t.pendingProps);case 24:xr(t,ft,e.memoizedState.cache)}return cr(e,t,a)}function Ig(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Ip(e,a)&&(t.flags&128)===0)return ht=!1,Xy(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Me&&(t.flags&1048576)!==0&&eg(t,qo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Mp(e)?(r=pi(e,r),t.tag=1,t=Af(null,t,e,r,a)):(t.tag=0,t=Iu(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===hp){t.tag=11,t=qf(null,t,e,r,a);break e}else if(i===gp){t.tag=14,t=Ef(null,t,e,r,a);break e}}throw t=Nu(e)||e,Error(B(306,t,""))}}return t;case 0:return Iu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=pi(r,t.pendingProps),Af(e,t,r,i,a);case 3:e:{if(Il(t,t.stateNode.containerInfo),e===null)throw Error(B(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Gu(e,t),go(t,r,null,a);var o=t.memoizedState;if(r=o.cache,xr(t,ft,r),r!==n.cache&&ju(t,[ft],a,!0),ho(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Rf(e,t,r,a);break e}else if(r!==i){i=ba(Error(B(424)),t),Eo(i),t=Rf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,We=ya(e.firstChild),Mt=t,Me=!0,Ar=null,wa=!0,a=og(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===i){t=cr(e,t,a);break e}qt(e,t,r,a)}t=t.child}return t;case 26:return Xl(e,t),e===null?(a=ah(t.type,null,t.pendingProps,null))?t.memoizedState=a:Me||(a=t.type,e=t.pendingProps,r=vs(zr.current).createElement(a),r[Et]=t,r[Pt]=e,zt(r,a,e),kt(r),t.stateNode=r):t.memoizedState=ah(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Cu(t),e===null&&Me&&(r=t.stateNode=Qb(t.type,t.pendingProps,zr.current),Mt=t,wa=!0,i=We,Vr(t.type)?(dp=i,We=ya(r.firstChild)):We=i),qt(e,t,t.pendingProps.children,a),Xl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Me&&((i=r=We)&&(r=w1(r,t.type,t.pendingProps,wa),r!==null?(t.stateNode=r,Mt=t,We=ya(r.firstChild),wa=!1,i=!0):i=!1),i||Qr(t)),Cu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,sp(i,n)?r=null:o!==null&&sp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Lp(e,t,Dy,null,null,a),Uo._currentValue=i),Xl(e,t),qt(e,t,r,a),t.child;case 6:return e===null&&Me&&((e=a=We)&&(a=v1(a,t.pendingProps,wa),a!==null?(t.stateNode=a,Mt=t,We=null,e=!0):e=!1),e||Qr(t)),null;case 13:return Pg(e,t,a);case 4:return Il(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):qt(e,t,r,a),t.child;case 11:return qf(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,xr(t,t.type,r.value),qt(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,si(t),i=Tt(i),r=r(i),t.flags|=1,qt(e,t,r,a),t.child;case 14:return Ef(e,t,t.type,t.pendingProps,a);case 15:return Zg(e,t,t.type,t.pendingProps,a);case 19:return Jg(e,t,a);case 31:return Yy(e,t,a);case 22:return Kg(e,t,a,t.pendingProps);case 24:return si(t),r=Tt(ft),e===null?(i=Rp(),i===null&&(i=$e,n=Ap(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},Dp(t),xr(t,ft,i)):((e.lanes&a)!==0&&(Gu(e,t),go(t,null,null,a),ho()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),xr(t,ft,r)):(r=n.cache,xr(t,ft,r),r!==i.cache&&ju(t,[ft],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Ka(e){e.flags|=4}function cu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(_b())e.flags|=8192;else throw ni=ns,Up}else e.flags&=-16777217}function Df(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xb(t))if(_b())e.flags|=8192;else throw ni=ns,Up}function El(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?xh():536870912,e.lanes|=t,dn|=t)}function eo(e,t){if(!Me)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Vy(e,t,a){var r=t.pendingProps;switch(zp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ir(ft),on(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Ka(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,eu())),Fe(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Ka(t),n!==null?(Fe(t),Df(t,n)):(Fe(t),cu(t,i,null,r,a))):n?n!==e.memoizedState?(Ka(t),Fe(t),Df(t,n)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ka(t),Fe(t),cu(t,i,e,r,a)),null;case 27:if(Fl(t),a=zr.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}e=La.current,Oi(t)?uf(t,e):(e=Qb(i,r,a),t.stateNode=e,Ka(t))}return Fe(t),null;case 5:if(Fl(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Fe(t),null}if(n=La.current,Oi(t))uf(t,n);else{var o=vs(zr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[Et]=t,n[Pt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(zt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ka(t)}}return Fe(t),cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(e=zr.current,Oi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Mt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Et]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Bb(e.nodeValue,a)),e||Qr(t,!0)}else e=vs(e).createTextNode(r),e[Et]=t,t.stateNode=e}return Fe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),a!==null){if(e===null){if(!r)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else a=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(aa(t),t):(aa(t),null);if((t.flags&128)!==0)throw Error(B(558))}return Fe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else i=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(aa(t),t):(aa(t),null)}return aa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),El(t,t.updateQueue),Fe(t),null);case 4:return on(),e===null&&id(t.stateNode.containerInfo),Fe(t),null;case 10:return ir(t.type),Fe(t),null;case 19:if(Nt(st),r=t.memoizedState,r===null)return Fe(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)eo(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=ls(e),n!==null){for(t.flags|=128,eo(r,!1),e=n.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Fh(a,e),a=a.sibling;return Je(st,st.current&1|2),Me&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&na()>ms&&(t.flags|=128,i=!0,eo(r,!1),t.lanes=4194304)}else{if(!i)if(e=ls(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),eo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Me)return Fe(t),null}else 2*na()-r.renderingStartTime>ms&&a!==536870912&&(t.flags|=128,i=!0,eo(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=na(),e.sibling=null,a=st.current,Je(st,i?a&1|2:a&1),Me&&Fa(t,r.treeForkCount),e):(Fe(t),null);case 22:case 23:return aa(t),Op(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&El(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&Nt(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ir(ft),Fe(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function $y(e,t){switch(zp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(ft),on(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fl(t),null;case 31:if(t.memoizedState!==null){if(aa(t),t.alternate===null)throw Error(B(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Nt(st),null;case 4:return on(),null;case 10:return ir(t.type),null;case 22:case 23:return aa(t),Op(),e!==null&&Nt(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(ft),null;case 25:return null;default:return null}}function Fg(e,t){switch(zp(t),t.tag){case 3:ir(ft),on();break;case 26:case 27:case 5:Fl(t);break;case 4:on();break;case 31:t.memoizedState!==null&&aa(t);break;case 13:aa(t);break;case 19:Nt(st);break;case 10:ir(t.type);break;case 22:case 23:aa(t),Op(),e!==null&&Nt(ii);break;case 24:ir(ft)}}function Vo(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){je(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(d){je(i,c,d)}}}r=r.next}while(r!==n)}}catch(d){je(t,t.return,d)}}function Wg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{sg(t,a)}catch(r){je(e,e.return,r)}}}function eb(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){je(e,t,r)}}function wo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){je(e,t,i)}}function Ba(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){je(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){je(e,t,i)}else a.current=null}function tb(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){je(e,e.return,i)}}function uu(e,t,a){try{var r=e.stateNode;d1(r,e.type,a,t),r[Pt]=t}catch(i){je(e,e.return,i)}}function ab(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vr(e.type)||e.tag===4}function pu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ab(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=tr));else if(r!==4&&(r===27&&Vr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Wu(e,t,a),e=e.sibling;e!==null;)Wu(e,t,a),e=e.sibling}function ds(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Vr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ds(e,t,a),e=e.sibling;e!==null;)ds(e,t,a),e=e.sibling}function rb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,r,a),t[Et]=e,t[Pt]=a}catch(n){je(e,e.return,n)}}var Wa=!1,mt=!1,du=!1,Of=typeof WeakSet=="function"?WeakSet:Set,xt=null;function Zy(e,t){if(e=e.containerInfo,op=ks,e=Xh(e),Cp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,d=0,g=e,m=null;t:for(;;){for(var b;g!==a||i!==0&&g.nodeType!==3||(l=o+i),g!==n||r!==0&&g.nodeType!==3||(c=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(b=g.firstChild)!==null;)m=g,g=b;for(;;){if(g===e)break t;if(m===a&&++p===i&&(l=o),m===n&&++d===r&&(c=o),(b=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(lp={focusedElem:e,selectionRange:a},ks=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var y=pi(a.type,i);e=r.getSnapshotBeforeUpdate(y,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(T){je(a,a.return,T)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)cp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(B(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function ib(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ja(e,a),r&4&&Vo(5,a);break;case 1:if(Ja(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){je(a,a.return,o)}else{var i=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){je(a,a.return,o)}}r&64&&Wg(a),r&512&&wo(a,a.return);break;case 3:if(Ja(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{sg(e,t)}catch(o){je(a,a.return,o)}}break;case 27:t===null&&r&4&&rb(a);case 26:case 5:Ja(e,a),t===null&&r&4&&tb(a),r&512&&wo(a,a.return);break;case 12:Ja(e,a);break;case 31:Ja(e,a),r&4&&lb(e,a);break;case 13:Ja(e,a),r&4&&sb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=a1.bind(null,a),y1(e,a))));break;case 22:if(r=a.memoizedState!==null||Wa,!r){t=t!==null&&t.memoizedState!==null||mt,i=Wa;var n=mt;Wa=r,(mt=t)&&!n?Ia(e,a,(a.subtreeFlags&8772)!==0):Ja(e,a),Wa=i,mt=n}break;case 30:break;default:Ja(e,a)}}function nb(e){var t=e.alternate;t!==null&&(e.alternate=null,nb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yp(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var at=null,$t=!1;function Pa(e,t,a){for(a=a.child;a!==null;)ob(e,t,a),a=a.sibling}function ob(e,t,a){if(oa&&typeof oa.onCommitFiberUnmount=="function")try{oa.onCommitFiberUnmount(Lo,a)}catch{}switch(a.tag){case 26:mt||Ba(a,t),Pa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:mt||Ba(a,t);var r=at,i=$t;Vr(a.type)&&(at=a.stateNode,$t=!1),Pa(e,t,a),xo(a.stateNode),at=r,$t=i;break;case 5:mt||Ba(a,t);case 6:if(r=at,i=$t,at=null,Pa(e,t,a),at=r,$t=i,at!==null)if($t)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(n){je(a,t,n)}else try{at.removeChild(a.stateNode)}catch(n){je(a,t,n)}break;case 18:at!==null&&($t?(e=at,If(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),gn(e)):If(at,a.stateNode));break;case 4:r=at,i=$t,at=a.stateNode.containerInfo,$t=!0,Pa(e,t,a),at=r,$t=i;break;case 0:case 11:case 14:case 15:Gr(2,a,t),mt||Gr(4,a,t),Pa(e,t,a);break;case 1:mt||(Ba(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&eb(a,t,r)),Pa(e,t,a);break;case 21:Pa(e,t,a);break;case 22:mt=(r=mt)||a.memoizedState!==null,Pa(e,t,a),mt=r;break;default:Pa(e,t,a)}}function lb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(a){je(t,t.return,a)}}}function sb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(a){je(t,t.return,a)}}function Ky(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Of),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Of),t;default:throw Error(B(435,e.tag))}}function Ml(e,t){var a=Ky(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=r1.bind(null,e,r);r.then(i,i)}})}function Xt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Vr(l.type)){at=l.stateNode,$t=!1;break e}break;case 5:at=l.stateNode,$t=!1;break e;case 3:case 4:at=l.stateNode.containerInfo,$t=!0;break e}l=l.return}if(at===null)throw Error(B(160));ob(n,o,i),at=null,$t=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cb(t,e),t=t.sibling}var Ma=null;function cb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(t,e),Vt(e),r&4&&(Gr(3,e,e.return),Vo(3,e),Gr(5,e,e.return));break;case 1:Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),r&64&&Wa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=Ma;if(Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[Qo]||n[Et]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),zt(n,r,a),n[Et]=e,kt(n),r=n;break e;case"link":var o=ih("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=ih("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;default:throw Error(B(468,r))}n[Et]=e,kt(n),r=n}e.stateNode=r}else nh(i,e.type,e.stateNode);else e.stateNode=rh(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?nh(i,e.type,e.stateNode):rh(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&uu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),a!==null&&r&4&&uu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),e.flags&32){i=e.stateNode;try{sn(i,"")}catch(y){je(e,e.return,y)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,uu(e,i,a!==null?a.memoizedProps:i)),r&1024&&(du=!0);break;case 6:if(Xt(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(B(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(y){je(e,e.return,y)}}break;case 3:if(Zl=null,i=Ma,Ma=ys(t.containerInfo),Xt(t,e),Ma=i,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{gn(t.containerInfo)}catch(y){je(e,e.return,y)}du&&(du=!1,ub(e));break;case 4:r=Ma,Ma=ys(e.stateNode.containerInfo),Xt(t,e),Vt(e),Ma=r;break;case 12:Xt(t,e),Vt(e);break;case 31:Xt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 13:Xt(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Os=na()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=Wa,d=mt;if(Wa=p||i,mt=d||c,Xt(t,e),mt=d,Wa=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||Wa||mt||ti(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var g=c.memoizedProps.style,m=g!=null&&g.hasOwnProperty("display")?g.display:null;l.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(y){je(c,c.return,y)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(y){je(c,c.return,y)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?Ff(b,!0):Ff(c.stateNode,!1)}catch(y){je(c,c.return,y)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ml(e,a))));break;case 19:Xt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 30:break;case 21:break;default:Xt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(ab(r)){a=r;break}r=r.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var i=a.stateNode,n=pu(e);ds(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(sn(o,""),a.flags&=-33);var l=pu(e);ds(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=pu(e);Wu(e,p,c);break;default:throw Error(B(161))}}catch(d){je(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ub(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ub(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ib(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gr(4,t,t.return),ti(t);break;case 1:Ba(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&eb(t,t.return,a),ti(t);break;case 27:xo(t.stateNode);case 26:case 5:Ba(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Ia(i,n,a),Vo(4,n);break;case 1:if(Ia(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){je(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)lg(c[i],l)}catch(p){je(r,r.return,p)}}a&&o&64&&Wg(n),wo(n,n.return);break;case 27:rb(n);case 26:case 5:Ia(i,n,a),a&&r===null&&o&4&&tb(n),wo(n,n.return);break;case 12:Ia(i,n,a);break;case 31:Ia(i,n,a),a&&o&4&&lb(i,n);break;case 13:Ia(i,n,a),a&&o&4&&sb(i,n);break;case 22:n.memoizedState===null&&Ia(i,n,a),wo(n,n.return);break;case 30:break;default:Ia(i,n,a)}t=t.sibling}}function Fp(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Yo(a))}function Wp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yo(e))}function Ea(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)pb(e,t,a,r),t=t.sibling}function pb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,r),i&2048&&Vo(9,t);break;case 1:Ea(e,t,a,r);break;case 3:Ea(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yo(e)));break;case 12:if(i&2048){Ea(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){je(t,t.return,c)}}else Ea(e,t,a,r);break;case 31:Ea(e,t,a,r);break;case 13:Ea(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ea(e,t,a,r):vo(e,t):n._visibility&2?Ea(e,t,a,r):(n._visibility|=2,Li(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Fp(o,t);break;case 24:Ea(e,t,a,r),i&2048&&Wp(t.alternate,t);break;default:Ea(e,t,a,r)}}function Li(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Li(n,o,l,c,i),Vo(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?Li(n,o,l,c,i):vo(n,o):(d._visibility|=2,Li(n,o,l,c,i)),i&&p&2048&&Fp(o.alternate,o);break;case 24:Li(n,o,l,c,i),i&&p&2048&&Wp(o.alternate,o);break;default:Li(n,o,l,c,i)}t=t.sibling}}function vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:vo(a,r),i&2048&&Fp(r.alternate,r);break;case 24:vo(a,r),i&2048&&Wp(r.alternate,r);break;default:vo(a,r)}t=t.sibling}}var so=8192;function Bi(e,t,a){if(e.subtreeFlags&so)for(e=e.child;e!==null;)db(e,t,a),e=e.sibling}function db(e,t,a){switch(e.tag){case 26:Bi(e,t,a),e.flags&so&&e.memoizedState!==null&&A1(a,Ma,e.memoizedState,e.memoizedProps);break;case 5:Bi(e,t,a);break;case 3:case 4:var r=Ma;Ma=ys(e.stateNode.containerInfo),Bi(e,t,a),Ma=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=so,so=16777216,Bi(e,t,a),so=r):Bi(e,t,a));break;default:Bi(e,t,a)}}function mb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function to(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];xt=r,hb(r,e)}mb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)fb(e),e=e.sibling}function fb(e){switch(e.tag){case 0:case 11:case 15:to(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:to(e);break;case 12:to(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):to(e);break;default:to(e)}}function Vl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];xt=r,hb(r,e)}mb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),Vl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function hb(e,t){for(;xt!==null;){var a=xt;switch(a.tag){case 0:case 11:case 15:Gr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Yo(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,xt=r;else e:for(a=e;xt!==null;){r=xt;var i=r.sibling,n=r.return;if(nb(r),r===a){xt=null;break e}if(i!==null){i.return=n,xt=i;break e}xt=n}}}var Py={getCacheForType:function(e){var t=Tt(ft),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ft).controller.signal}},Jy=typeof WeakMap=="function"?WeakMap:Map,De=0,$e=null,Ce=null,qe=0,He=0,ta=null,Er=!1,_n=!1,ed=!1,ur=0,nt=0,Yr=0,oi=0,td=0,ia=0,dn=0,yo=null,Zt=null,ep=!1,Os=0,gb=0,ms=1/0,fs=null,Dr=null,bt=0,Or=null,mn=null,nr=0,tp=0,ap=null,bb=null,_o=0,rp=null;function sa(){return(De&2)!==0&&qe!==0?qe&-qe:le.T!==null?rd():Ch()}function wb(){if(ia===0)if((qe&536870912)===0||Me){var e=vl;vl<<=1,(vl&3932160)===0&&(vl=262144),ia=e}else ia=536870912;return e=ua.current,e!==null&&(e.flags|=32),ia}function Kt(e,t,a){(e===$e&&(He===2||He===9)||e.cancelPendingCommit!==null)&&(fn(e,0),Mr(e,qe,ia,!1)),jo(e,a),((De&2)===0||e!==$e)&&(e===$e&&((De&2)===0&&(oi|=a),nt===4&&Mr(e,qe,ia,!1)),ja(e))}function vb(e,t,a){if((De&6)!==0)throw Error(B(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ho(e,t),i=r?Wy(e,t):mu(e,t,!0),n=r;do{if(i===0){_n&&!r&&Mr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!Iy(a)){i=mu(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=yo;var c=l.current.memoizedState.isDehydrated;if(c&&(fn(l,o).flags|=256),o=mu(l,o,!1),o!==2){if(ed&&!c){l.errorRecoveryDisabledLanes|=n,oi|=n,i=4;break e}n=Zt,Zt=i,n!==null&&(Zt===null?Zt=n:Zt.push.apply(Zt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){fn(e,0),Mr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:Mr(r,t,ia,!Er);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(i=Os+300-na(),10<i)){if(Mr(r,t,ia,!Er),Ss(r,0,!0)!==0)break e;nr=t,r.timeoutHandle=Hb(Bf.bind(null,r,a,Zt,fs,ep,t,ia,oi,dn,Er,n,"Throttled",-0,0),i);break e}Bf(r,a,Zt,fs,ep,t,ia,oi,dn,Er,n,null,-0,0)}}break}while(!0);ja(e)}function Bf(e,t,a,r,i,n,o,l,c,p,d,g,m,b){if(e.timeoutHandle=-1,g=t.subtreeFlags,g&8192||(g&16785408)===16785408){g={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tr},db(t,n,g);var y=(n&62914560)===n?Os-na():(n&4194048)===n?gb-na():0;if(y=R1(g,y),y!==null){nr=n,e.cancelPendingCommit=y(Hf.bind(null,e,t,n,a,r,i,o,l,c,d,g,null,m,b)),Mr(e,n,o,!p);return}}Hf(e,t,n,a,r,i,o,l,c)}function Iy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!ca(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mr(e,t,a,r){t&=~td,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-la(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&kh(e,a,t)}function Bs(){return(De&6)===0?($o(0,!1),!1):!0}function ad(){if(Ce!==null){if(He===0)var e=Ce.return;else e=Ce,ar=gi=null,Qp(e),an=null,Mo=0,e=Ce;for(;e!==null;)Fg(e.alternate,e),e=e.return;Ce=null}}function fn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,h1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),nr=0,ad(),$e=e,Ce=a=rr(e.current,null),qe=t,He=0,ta=null,Er=!1,_n=Ho(e,t),ed=!1,dn=ia=td=oi=Yr=nt=0,Zt=yo=null,ep=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-la(r),n=1<<i;t|=e[i],r&=~n}return ur=t,Ms(),a}function yb(e,t){fe=null,le.H=zo,t===yn||t===zs?(t=hf(),He=3):t===Up?(t=hf(),He=4):He=t===Jp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Ce===null&&(nt=1,us(e,ba(t,e.current)))}function _b(){var e=ua.current;return e===null?!0:(qe&4194048)===qe?va===null:(qe&62914560)===qe||(qe&536870912)!==0?e===va:!1}function xb(){var e=le.H;return le.H=zo,e===null?zo:e}function kb(){var e=le.A;return le.A=Py,e}function hs(){nt=4,Er||(qe&4194048)!==qe&&ua.current!==null||(_n=!0),(Yr&134217727)===0&&(oi&134217727)===0||$e===null||Mr($e,qe,ia,!1)}function mu(e,t,a){var r=De;De|=2;var i=xb(),n=kb();($e!==e||qe!==t)&&(fs=null,fn(e,t)),t=!1;var o=nt;e:do try{if(He!==0&&Ce!==null){var l=Ce,c=ta;switch(He){case 8:ad(),o=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(t=!0);var p=He;if(He=0,ta=null,Ii(e,l,c,p),a&&_n){o=0;break e}break;default:p=He,He=0,ta=null,Ii(e,l,c,p)}}Fy(),o=nt;break}catch(d){yb(e,d)}while(!0);return t&&e.shellSuspendCounter++,ar=gi=null,De=r,le.H=i,le.A=n,Ce===null&&($e=null,qe=0,Ms()),o}function Fy(){for(;Ce!==null;)Nb(Ce)}function Wy(e,t){var a=De;De|=2;var r=xb(),i=kb();$e!==e||qe!==t?(fs=null,ms=na()+500,fn(e,t)):_n=Ho(e,t);e:do try{if(He!==0&&Ce!==null){t=Ce;var n=ta;t:switch(He){case 1:He=0,ta=null,Ii(e,t,n,1);break;case 2:case 9:if(ff(n)){He=0,ta=null,Lf(t);break}t=function(){He!==2&&He!==9||$e!==e||(He=7),ja(e)},n.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:ff(n)?(He=0,ta=null,Lf(t)):(He=0,ta=null,Ii(e,t,n,7));break;case 5:var o=null;switch(Ce.tag){case 26:o=Ce.memoizedState;case 5:case 27:var l=Ce;if(o?Xb(o):l.stateNode.complete){He=0,ta=null;var c=l.sibling;if(c!==null)Ce=c;else{var p=l.return;p!==null?(Ce=p,Ls(p)):Ce=null}break t}}He=0,ta=null,Ii(e,t,n,5);break;case 6:He=0,ta=null,Ii(e,t,n,6);break;case 8:ad(),nt=6;break e;default:throw Error(B(462))}}e1();break}catch(d){yb(e,d)}while(!0);return ar=gi=null,le.H=r,le.A=i,De=a,Ce!==null?0:($e=null,qe=0,Ms(),nt)}function e1(){for(;Ce!==null&&!k0();)Nb(Ce)}function Nb(e){var t=Ig(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?Ls(e):Ce=t}function Lf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=zf(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=zf(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Qp(t);default:Fg(a,t),t=Ce=Fh(t,ur),t=Ig(a,t,ur)}e.memoizedProps=e.pendingProps,t===null?Ls(e):Ce=t}function Ii(e,t,a,r){ar=gi=null,Qp(t),an=null,Mo=0;var i=t.return;try{if(Gy(e,i,t,a,qe)){nt=1,us(e,ba(a,e.current)),Ce=null;return}}catch(n){if(i!==null)throw Ce=i,n;nt=1,us(e,ba(a,e.current)),Ce=null;return}t.flags&32768?(Me||r===1?e=!0:_n||(qe&536870912)!==0?e=!1:(Er=e=!0,(r===2||r===9||r===3||r===6)&&(r=ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),Sb(t,e)):Ls(t)}function Ls(e){var t=e;do{if((t.flags&32768)!==0){Sb(t,Er);return}e=t.return;var a=Vy(t.alternate,t,ur);if(a!==null){Ce=a;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);nt===0&&(nt=5)}function Sb(e,t){do{var a=$y(e.alternate,e);if(a!==null){a.flags&=32767,Ce=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=a}while(e!==null);nt=6,Ce=null}function Hf(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Hs();while(bt!==0);if((De&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(n=t.lanes|t.childLanes,n|=qp,R0(e,a,n,o,l,c),e===$e&&(Ce=$e=null,qe=0),mn=t,Or=e,nr=a,tp=n,ap=i,bb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,i1(Wl,function(){return Tb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=le.T,le.T=null,i=Oe.p,Oe.p=2,o=De,De|=4;try{Zy(e,t,a)}finally{De=o,Oe.p=i,le.T=r}}bt=1,Cb(),qb(),Eb()}}function Cb(){if(bt===1){bt=0;var e=Or,t=mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=le.T,le.T=null;var r=Oe.p;Oe.p=2;var i=De;De|=4;try{cb(t,e);var n=lp,o=Xh(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&Yh(l.ownerDocument.documentElement,l)){if(c!==null&&Cp(l)){var p=c.start,d=c.end;if(d===void 0&&(d=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(d,l.value.length);else{var g=l.ownerDocument||document,m=g&&g.defaultView||window;if(m.getSelection){var b=m.getSelection(),y=l.textContent.length,T=Math.min(c.start,y),D=c.end===void 0?T:Math.min(c.end,y);!b.extend&&T>D&&(o=D,D=T,T=o);var f=lf(l,T),u=lf(l,D);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var w=g.createRange();w.setStart(f.node,f.offset),b.removeAllRanges(),T>D?(b.addRange(w),b.extend(u.node,u.offset)):(w.setEnd(u.node,u.offset),b.addRange(w))}}}}for(g=[],b=l;b=b.parentNode;)b.nodeType===1&&g.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<g.length;l++){var v=g[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}ks=!!op,lp=op=null}finally{De=i,Oe.p=r,le.T=a}}e.current=t,bt=2}}function qb(){if(bt===2){bt=0;var e=Or,t=mn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=le.T,le.T=null;var r=Oe.p;Oe.p=2;var i=De;De|=4;try{ib(e,t.alternate,t)}finally{De=i,Oe.p=r,le.T=a}}bt=3}}function Eb(){if(bt===4||bt===3){bt=0,N0();var e=Or,t=mn,a=nr,r=bb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,mn=Or=null,Mb(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Dr=null),vp(a),t=t.stateNode,oa&&typeof oa.onCommitFiberRoot=="function")try{oa.onCommitFiberRoot(Lo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=le.T,i=Oe.p,Oe.p=2,le.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{le.T=t,Oe.p=i}}(nr&3)!==0&&Hs(),ja(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===rp?_o++:(_o=0,rp=e):_o=0,$o(0,!1)}}function Mb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yo(t)))}function Hs(){return Cb(),qb(),Eb(),Tb()}function Tb(){if(bt!==5)return!1;var e=Or,t=tp;tp=0;var a=vp(nr),r=le.T,i=Oe.p;try{Oe.p=32>a?32:a,le.T=null,a=ap,ap=null;var n=Or,o=nr;if(bt=0,mn=Or=null,nr=0,(De&6)!==0)throw Error(B(331));var l=De;if(De|=4,fb(n.current),pb(n,n.current,o,a),De=l,$o(0,!1),oa&&typeof oa.onPostCommitFiberRoot=="function")try{oa.onPostCommitFiberRoot(Lo,n)}catch{}return!0}finally{Oe.p=i,le.T=r,Mb(e,t)}}function jf(e,t,a){t=ba(a,t),t=Ju(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(jo(e,2),ja(e))}function je(e,t,a){if(e.tag===3)jf(e,e,a);else for(;t!==null;){if(t.tag===3){jf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dr===null||!Dr.has(r))){e=ba(a,e),a=Vg(2),r=Ur(t,a,2),r!==null&&($g(a,r,t,e),jo(r,2),ja(r));break}}t=t.return}}function fu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Jy;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(ed=!0,i.add(a),e=t1.bind(null,e,t,a),t.then(e,e))}function t1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(qe&a)===a&&(nt===4||nt===3&&(qe&62914560)===qe&&300>na()-Os?(De&2)===0&&fn(e,0):td|=a,dn===qe&&(dn=0)),ja(e)}function zb(e,t){t===0&&(t=xh()),e=hi(e,t),e!==null&&(jo(e,t),ja(e))}function a1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),zb(e,a)}function r1(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(B(314))}r!==null&&r.delete(t),zb(e,a)}function i1(e,t){return bp(e,t)}var gs=null,Hi=null,ip=!1,bs=!1,hu=!1,Tr=0;function ja(e){e!==Hi&&e.next===null&&(Hi===null?gs=Hi=e:Hi=Hi.next=e),bs=!0,ip||(ip=!0,o1())}function $o(e,t){if(!hu&&bs){hu=!0;do for(var a=!1,r=gs;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-la(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Qf(r,n))}else n=qe,n=Ss(r,r===$e?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Ho(r,n)||(a=!0,Qf(r,n));r=r.next}while(a);hu=!1}}function n1(){Ab()}function Ab(){bs=ip=!1;var e=0;Tr!==0&&f1()&&(e=Tr);for(var t=na(),a=null,r=gs;r!==null;){var i=r.next,n=Rb(r,t);n===0?(r.next=null,a===null?gs=i:a.next=i,i===null&&(Hi=a)):(a=r,(e!==0||(n&3)!==0)&&(bs=!0)),r=i}bt!==0&&bt!==5||$o(e,!1),Tr!==0&&(Tr=0)}function Rb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-la(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=A0(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=$e,a=qe,a=Ss(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Xc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ho(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Xc(r),vp(a)){case 2:case 8:a=yh;break;case 32:a=Wl;break;case 268435456:a=_h;break;default:a=Wl}return r=Ub.bind(null,e),a=bp(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Xc(r),e.callbackPriority=2,e.callbackNode=null,2}function Ub(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hs()&&e.callbackNode!==a)return null;var r=qe;return r=Ss(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vb(e,r,t),Rb(e,na()),e.callbackNode!=null&&e.callbackNode===a?Ub.bind(null,e):null)}function Qf(e,t){if(Hs())return null;vb(e,t,!0)}function o1(){g1(function(){(De&6)!==0?bp(vh,n1):Ab()})}function rd(){if(Tr===0){var e=cn;e===0&&(e=wl,wl<<=1,(wl&261888)===0&&(wl=256)),Tr=e}return Tr}function Gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ol(""+e)}function Yf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function l1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=Gf((i[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?Gf(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new Cs("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tr!==0){var c=o?Yf(i,o):new FormData(i);Ku(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?Yf(i,o):new FormData(i),Ku(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Tl=0;Tl<Ou.length;Tl++)zl=Ou[Tl],Xf=zl.toLowerCase(),Vf=zl[0].toUpperCase()+zl.slice(1),Ta(Xf,"on"+Vf);var zl,Xf,Vf,Tl;Ta($h,"onAnimationEnd");Ta(Zh,"onAnimationIteration");Ta(Kh,"onAnimationStart");Ta("dblclick","onDoubleClick");Ta("focusin","onFocus");Ta("focusout","onBlur");Ta(Sy,"onTransitionRun");Ta(Cy,"onTransitionStart");Ta(qy,"onTransitionCancel");Ta(Ph,"onTransitionEnd");ln("onMouseEnter",["mouseout","mouseover"]);ln("onMouseLeave",["mouseout","mouseover"]);ln("onPointerEnter",["pointerout","pointerover"]);ln("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),s1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ao));function Db(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}}}}function Se(e,t){var a=t[Eu];a===void 0&&(a=t[Eu]=new Set);var r=e+"__bubble";a.has(r)||(Ob(t,e,2,!1),a.add(r))}function gu(e,t,a){var r=0;t&&(r|=4),Ob(a,e,r,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function id(e){if(!e[Al]){e[Al]=!0,qh.forEach(function(a){a!=="selectionchange"&&(s1.has(a)||gu(a,!1,e),gu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,gu("selectionchange",!1,t))}}function Ob(e,t,a,r){switch(Pb(t)){case 2:var i=O1;break;case 8:i=B1;break;default:i=sd}a=i.bind(null,t,a,e),i=void 0,!Ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function bu(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Dh(function(){var p=n,d=xp(a),g=[];e:{var m=Jh.get(e);if(m!==void 0){var b=Cs,y=e;switch(e){case"keypress":if(Ll(a)===0)break e;case"keydown":case"keyup":b=ry;break;case"focusin":y="focus",b=Pc;break;case"focusout":y="blur",b=Pc;break;case"beforeblur":case"afterblur":b=Pc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=Im;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=V0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=oy;break;case $h:case Zh:case Kh:b=K0;break;case Ph:b=sy;break;case"scroll":case"scrollend":b=Y0;break;case"wheel":b=uy;break;case"copy":case"cut":case"paste":b=J0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=Wm;break;case"toggle":case"beforetoggle":b=dy}var T=(t&4)!==0,D=!T&&(e==="scroll"||e==="scrollend"),f=T?m!==null?m+"Capture":null:m;T=[];for(var u=p,w;u!==null;){var v=u;if(w=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||w===null||f===null||(v=No(u,f),v!=null&&T.push(Ro(u,v,w))),D)break;u=u.return}0<T.length&&(m=new b(m,y,null,a,d),g.push({event:m,listeners:T}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",m&&a!==Au&&(y=a.relatedTarget||a.fromElement)&&(Gi(y)||y[bn]))break e;if((b||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,b?(y=a.relatedTarget||a.toElement,b=p,y=y?Gi(y):null,y!==null&&(D=Bo(y),T=y.tag,y!==D||T!==5&&T!==27&&T!==6)&&(y=null)):(b=null,y=p),b!==y)){if(T=Im,v="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(T=Wm,v="onPointerLeave",f="onPointerEnter",u="pointer"),D=b==null?m:oo(b),w=y==null?m:oo(y),m=new T(v,u+"leave",b,a,d),m.target=D,m.relatedTarget=w,v=null,Gi(d)===p&&(T=new T(f,u+"enter",y,a,d),T.target=w,T.relatedTarget=D,v=T),D=v,b&&y)t:{for(T=c1,f=b,u=y,w=0,v=f;v;v=T(v))w++;v=0;for(var S=u;S;S=T(S))v++;for(;0<w-v;)f=T(f),w--;for(;0<v-w;)u=T(u),v--;for(;w--;){if(f===u||u!==null&&f===u.alternate){T=f;break t}f=T(f),u=T(u)}T=null}else T=null;b!==null&&$f(g,m,b,T,!1),y!==null&&D!==null&&$f(g,D,y,T,!0)}}e:{if(m=p?oo(p):window,b=m.nodeName&&m.nodeName.toLowerCase(),b==="select"||b==="input"&&m.type==="file")var R=rf;else if(af(m))if(Qh)R=xy;else{R=yy;var z=vy}else b=m.nodeName,!b||b.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?p&&_p(p.elementType)&&(R=rf):R=_y;if(R&&(R=R(e,p))){jh(g,R,a,d);break e}z&&z(e,m,p),e==="focusout"&&p&&m.type==="number"&&p.memoizedProps.value!=null&&zu(m,"number",m.value)}switch(z=p?oo(p):window,e){case"focusin":(af(z)||z.contentEditable==="true")&&(Vi=z,Uu=p,po=null);break;case"focusout":po=Uu=Vi=null;break;case"mousedown":Du=!0;break;case"contextmenu":case"mouseup":case"dragend":Du=!1,sf(g,a,d);break;case"selectionchange":if(Ny)break;case"keydown":case"keyup":sf(g,a,d)}var A;if(Sp)e:{switch(e){case"compositionstart":var Q="onCompositionStart";break e;case"compositionend":Q="onCompositionEnd";break e;case"compositionupdate":Q="onCompositionUpdate";break e}Q=void 0}else Xi?Lh(e,a)&&(Q="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Q="onCompositionStart");Q&&(Bh&&a.locale!=="ko"&&(Xi||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&Xi&&(A=Oh()):(qr=d,kp="value"in qr?qr.value:qr.textContent,Xi=!0)),z=ws(p,Q),0<z.length&&(Q=new Fm(Q,e,null,a,d),g.push({event:Q,listeners:z}),A?Q.data=A:(A=Hh(a),A!==null&&(Q.data=A)))),(A=fy?hy(e,a):gy(e,a))&&(Q=ws(p,"onBeforeInput"),0<Q.length&&(z=new Fm("onBeforeInput","beforeinput",null,a,d),g.push({event:z,listeners:Q}),z.data=A)),l1(g,e,p,a,d)}Db(g,t)})}function Ro(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ws(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=No(e,a),i!=null&&r.unshift(Ro(e,i,n)),i=No(e,t),i!=null&&r.push(Ro(e,i,n))),e.tag===3)return r;e=e.return}return[]}function c1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=No(a,n),p!=null&&o.unshift(Ro(a,p,c))):i||(p=No(a,n),p!=null&&o.push(Ro(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var u1=/\r\n?/g,p1=/\u0000|\uFFFD/g;function Zf(e){return(typeof e=="string"?e:""+e).replace(u1,`
9
- `).replace(p1,"")}function Bb(e,t){return t=Zf(t),Zf(e)===t}function Xe(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||sn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&sn(e,""+r);break;case"className":_l(e,"class",r);break;case"tabIndex":_l(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(e,a,r);break;case"style":Uh(e,r,n);break;case"data":if(t!=="object"){_l(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ol(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",i.name,i,null),Xe(e,t,"formEncType",i.formEncType,i,null),Xe(e,t,"formMethod",i.formMethod,i,null),Xe(e,t,"formTarget",i.formTarget,i,null)):(Xe(e,t,"encType",i.encType,i,null),Xe(e,t,"method",i.method,i,null),Xe(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Ol(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=tr);break;case"onScroll":r!=null&&Se("scroll",e);break;case"onScrollEnd":r!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Ol(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Dl(e,"popover",r);break;case"xlinkActuate":Za(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Za(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Za(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Za(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Za(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Za(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Za(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Za(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Za(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Dl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Q0.get(a)||a,Dl(e,a,r))}}function np(e,t,a,r,i,n){switch(a){case"style":Uh(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof r=="string"?sn(e,r):(typeof r=="number"||typeof r=="bigint")&&sn(e,""+r);break;case"onScroll":r!=null&&Se("scroll",e);break;case"onScrollEnd":r!=null&&Se("scrollend",e);break;case"onClick":r!=null&&(e.onclick=tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Eh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[Pt]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Dl(e,a,r)}}}function zt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Xe(e,t,n,o,a,null)}}i&&Xe(e,t,"srcSet",a.srcSet,a,null),r&&Xe(e,t,"src",a.src,a,null);return;case"input":Se("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"name":i=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":p=d;break;case"value":n=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(B(137,t));break;default:Xe(e,t,r,d,a,null)}}zh(e,n,l,c,p,o,i,!1);return;case"select":Se("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Xe(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?Wi(e,!!r,t,!1):a!=null&&Wi(e,!!r,a,!0);return;case"textarea":Se("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(B(91));break;default:Xe(e,t,o,l,a,null)}Rh(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Xe(e,t,c,r,a,null));return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(r=0;r<Ao.length;r++)Se(Ao[r],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Xe(e,t,p,r,a,null)}return;default:if(_p(t)){for(d in a)a.hasOwnProperty(d)&&(r=a[d],r!==void 0&&np(e,t,d,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&Xe(e,t,l,r,a,null))}function d1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,d=null;for(b in a){var g=a[b];if(a.hasOwnProperty(b)&&g!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=g;default:r.hasOwnProperty(b)||Xe(e,t,b,null,r,g)}}for(var m in r){var b=r[m];if(g=a[m],r.hasOwnProperty(m)&&(b!=null||g!=null))switch(m){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":d=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(B(137,t));break;default:b!==g&&Xe(e,t,m,b,r,g)}}Tu(e,o,l,c,p,d,n,i);return;case"select":b=o=l=m=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||Xe(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":m=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&Xe(e,t,i,n,r,c)}t=l,a=o,r=b,m!=null?Wi(e,!!a,m,!1):!!r!=!!a&&(t!=null?Wi(e,!!a,t,!0):Wi(e,!!a,a?[]:"",!1));return;case"textarea":b=m=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Xe(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":m=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(B(91));break;default:i!==n&&Xe(e,t,o,i,r,n)}Ah(e,m,b);return;case"option":for(var y in a)m=a[y],a.hasOwnProperty(y)&&m!=null&&!r.hasOwnProperty(y)&&(y==="selected"?e.selected=!1:Xe(e,t,y,null,r,m));for(c in r)m=r[c],b=a[c],r.hasOwnProperty(c)&&m!==b&&(m!=null||b!=null)&&(c==="selected"?e.selected=m&&typeof m!="function"&&typeof m!="symbol":Xe(e,t,c,m,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var T in a)m=a[T],a.hasOwnProperty(T)&&m!=null&&!r.hasOwnProperty(T)&&Xe(e,t,T,null,r,m);for(p in r)if(m=r[p],b=a[p],r.hasOwnProperty(p)&&m!==b&&(m!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(B(137,t));break;default:Xe(e,t,p,m,r,b)}return;default:if(_p(t)){for(var D in a)m=a[D],a.hasOwnProperty(D)&&m!==void 0&&!r.hasOwnProperty(D)&&np(e,t,D,void 0,r,m);for(d in r)m=r[d],b=a[d],!r.hasOwnProperty(d)||m===b||m===void 0&&b===void 0||np(e,t,d,m,r,b);return}}for(var f in a)m=a[f],a.hasOwnProperty(f)&&m!=null&&!r.hasOwnProperty(f)&&Xe(e,t,f,null,r,m);for(g in r)m=r[g],b=a[g],!r.hasOwnProperty(g)||m===b||m==null&&b==null||Xe(e,t,g,m,r,b)}function Kf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&Kf(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var d=c.transferSize,g=c.initiatorType;d&&Kf(g)&&(c=c.responseEnd,o+=d*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var op=null,lp=null;function vs(e){return e.nodeType===9?e:e.ownerDocument}function Pf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function sp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wu=null;function f1(){var e=window.event;return e&&e.type==="popstate"?e===wu?!1:(wu=e,!0):(wu=null,!1)}var Hb=typeof setTimeout=="function"?setTimeout:void 0,h1=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,g1=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(e){return Jf.resolve(null).then(e).catch(b1)}:Hb;function b1(e){setTimeout(function(){throw e})}function Vr(e){return e==="head"}function If(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),gn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")xo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,xo(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[Qo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&xo(e.ownerDocument.body);a=i}while(a);gn(t)}function Ff(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function cp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":cp(a),yp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function w1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Qo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function v1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function jb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function up(e){return e.data==="$?"||e.data==="$~"}function pp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function y1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var dp=null;function Wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function eh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Qb(e,t,a){switch(t=vs(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function xo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yp(e)}var _a=new Map,th=new Set;function ys(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pr=Oe.d;Oe.d={f:_1,r:x1,D:k1,C:N1,L:S1,m:C1,X:E1,S:q1,M:M1};function _1(){var e=pr.f(),t=Bs();return e||t}function x1(e){var t=wn(e);t!==null&&t.tag===5&&t.type==="form"?Ug(t):pr.r(e)}var xn=typeof document>"u"?null:document;function Gb(e,t,a){var r=xn;if(r&&typeof t=="string"&&t){var i=ga(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),th.has(i)||(th.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),zt(t,"link",e),kt(t),r.head.appendChild(t)))}}function k1(e){pr.D(e),Gb("dns-prefetch",e,null)}function N1(e,t){pr.C(e,t),Gb("preconnect",e,t)}function S1(e,t,a){pr.L(e,t,a);var r=xn;if(r&&e&&t){var i='link[rel="preload"][as="'+ga(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ga(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ga(a.imageSizes)+'"]')):i+='[href="'+ga(e)+'"]';var n=i;switch(t){case"style":n=hn(e);break;case"script":n=kn(e)}_a.has(n)||(e=et({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Zo(n))||t==="script"&&r.querySelector(Ko(n))||(t=r.createElement("link"),zt(t,"link",e),kt(t),r.head.appendChild(t)))}}function C1(e,t){pr.m(e,t);var a=xn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ga(r)+'"][href="'+ga(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=kn(e)}if(!_a.has(n)&&(e=et({rel:"modulepreload",href:e},t),_a.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ko(n)))return}r=a.createElement("link"),zt(r,"link",e),kt(r),a.head.appendChild(r)}}}function q1(e,t,a){pr.S(e,t,a);var r=xn;if(r&&e){var i=Fi(r).hoistableStyles,n=hn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Zo(n)))l.loading=5;else{e=et({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(n))&&nd(e,a);var c=o=r.createElement("link");kt(c),zt(c,"link",e),c._p=new Promise(function(p,d){c.onload=p,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,$l(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function E1(e,t){pr.X(e,t);var a=xn;if(a&&e){var r=Fi(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Ko(i)),n||(e=et({src:e,async:!0},t),(t=_a.get(i))&&od(e,t),n=a.createElement("script"),kt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function M1(e,t){pr.M(e,t);var a=xn;if(a&&e){var r=Fi(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Ko(i)),n||(e=et({src:e,async:!0,type:"module"},t),(t=_a.get(i))&&od(e,t),n=a.createElement("script"),kt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function ah(e,t,a,r){var i=(i=zr.current)?ys(i):null;if(!i)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=hn(a.href),a=Fi(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=hn(a.href);var n=Fi(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector(Zo(e)))&&!n._p&&(o.instance=n,o.state.loading=5),_a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_a.set(e,a),n||T1(i,e,a,o.state))),t&&r===null)throw Error(B(528,""));return o}if(t&&r!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kn(a),a=Fi(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(B(444,e))}}function hn(e){return'href="'+ga(e)+'"'}function Zo(e){return'link[rel="stylesheet"]['+e+"]"}function Yb(e){return et({},e,{"data-precedence":e.precedence,precedence:null})}function T1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),zt(t,"link",a),kt(t),e.head.appendChild(t))}function kn(e){return'[src="'+ga(e)+'"]'}function Ko(e){return"script[async]"+e}function rh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ga(a.href)+'"]');if(r)return t.instance=r,kt(r),r;var i=et({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),kt(r),zt(r,"style",i),$l(r,a.precedence,e),t.instance=r;case"stylesheet":i=hn(a.href);var n=e.querySelector(Zo(i));if(n)return t.state.loading|=4,t.instance=n,kt(n),n;r=Yb(a),(i=_a.get(i))&&nd(r,i),n=(e.ownerDocument||e).createElement("link"),kt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),t.state.loading|=4,$l(n,a.precedence,e),t.instance=n;case"script":return n=kn(a.src),(i=e.querySelector(Ko(n)))?(t.instance=i,kt(i),i):(r=a,(i=_a.get(n))&&(r=et({},a),od(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),kt(i),zt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,$l(r,a.precedence,e));return t.instance}function $l(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function ih(e,t,a){if(Zl===null){var r=new Map,i=Zl=new Map;i.set(a,r)}else i=Zl,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[Qo]||n[Et]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function nh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function z1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Xb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=hn(r.href),n=t.querySelector(Zo(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_s.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,kt(n);return}n=t.ownerDocument||t,r=Yb(r),(i=_a.get(i))&&nd(r,i),n=n.createElement("link"),kt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_s.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var vu=0;function R1(e,t){return e.stylesheets&&e.count===0&&Kl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&vu===0&&(vu=62500*m1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>vu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xs=null;function Kl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xs=new Map,t.forEach(U1,e),xs=null,_s.call(e))}function U1(e,t){if(!(t.state.loading&4)){var a=xs.get(e);if(a)var r=a.get(null);else{a=new Map,xs.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=_s.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Uo={$$typeof:er,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function D1(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vc(0),this.hiddenUpdates=Vc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Vb(e,t,a,r,i,n,o,l,c,p,d,g){return e=new D1(e,t,a,o,c,p,d,g,l),t=1,n===!0&&(t|=24),n=ra(3,null,null,t),e.current=n,n.stateNode=e,t=Ap(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},Dp(n),e}function $b(e){return e?(e=Ki,e):Ki}function Zb(e,t,a,r,i,n){i=$b(i),r.context===null?r.context=i:r.pendingContext=i,r=Rr(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Ur(e,r,t),a!==null&&(Kt(a,e,t),fo(a,e,t))}function oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ld(e,t){oh(e,t),(e=e.alternate)&&oh(e,t)}function Kb(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),ld(e,67108864)}}function lh(e){if(e.tag===13||e.tag===31){var t=sa();t=wp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),ld(e,t)}}var ks=!0;function O1(e,t,a,r){var i=le.T;le.T=null;var n=Oe.p;try{Oe.p=2,sd(e,t,a,r)}finally{Oe.p=n,le.T=i}}function B1(e,t,a,r){var i=le.T;le.T=null;var n=Oe.p;try{Oe.p=8,sd(e,t,a,r)}finally{Oe.p=n,le.T=i}}function sd(e,t,a,r){if(ks){var i=mp(r);if(i===null)bu(e,t,r,Ns,a),sh(e,r);else if(H1(i,e,t,a,r))r.stopPropagation();else if(sh(e,r),t&4&&-1<L1.indexOf(e)){for(;i!==null;){var n=wn(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Wr(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-la(o);l.entanglements[1]|=c,o&=~c}ja(n),(De&6)===0&&(ms=na()+500,$o(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Kt(l,n,2),Bs(),ld(n,2)}if(n=mp(r),n===null&&bu(e,t,r,Ns,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else bu(e,t,r,null,a)}}function mp(e){return e=xp(e),cd(e)}var Ns=null;function cd(e){if(Ns=null,e=Gi(e),e!==null){var t=Bo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=fh(t),e!==null)return e;e=null}else if(a===31){if(e=hh(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ns=e,null}function Pb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(S0()){case vh:return 2;case yh:return 8;case Wl:case C0:return 32;case _h:return 268435456;default:return 32}default:return 32}}var fp=!1,Br=null,Lr=null,Hr=null,Do=new Map,Oo=new Map,Sr=[],L1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function sh(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Do.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(t.pointerId)}}function ao(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=wn(t),t!==null&&Kb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function H1(e,t,a,r,i){switch(t){case"focusin":return Br=ao(Br,e,t,a,r,i),!0;case"dragenter":return Lr=ao(Lr,e,t,a,r,i),!0;case"mouseover":return Hr=ao(Hr,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Do.set(n,ao(Do.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,Oo.set(n,ao(Oo.get(n)||null,e,t,a,r,i)),!0}return!1}function Jb(e){var t=Gi(e.target);if(t!==null){var a=Bo(t);if(a!==null){if(t=a.tag,t===13){if(t=fh(a),t!==null){e.blockedOn=t,Xm(e.priority,function(){lh(a)});return}}else if(t===31){if(t=hh(a),t!==null){e.blockedOn=t,Xm(e.priority,function(){lh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=mp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Au=r,a.target.dispatchEvent(r),Au=null}else return t=wn(a),t!==null&&Kb(t),e.blockedOn=a,!1;t.shift()}return!0}function ch(e,t,a){Pl(e)&&a.delete(t)}function j1(){fp=!1,Br!==null&&Pl(Br)&&(Br=null),Lr!==null&&Pl(Lr)&&(Lr=null),Hr!==null&&Pl(Hr)&&(Hr=null),Do.forEach(ch),Oo.forEach(ch)}function Rl(e,t){e.blockedOn===t&&(e.blockedOn=null,fp||(fp=!0,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,j1)))}var Ul=null;function uh(e){Ul!==e&&(Ul=e,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,function(){Ul===e&&(Ul=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(cd(r||a)===null)continue;break}var n=wn(a);n!==null&&(e.splice(t,3),t-=3,Ku(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function gn(e){function t(c){return Rl(c,e)}Br!==null&&Rl(Br,e),Lr!==null&&Rl(Lr,e),Hr!==null&&Rl(Hr,e),Do.forEach(t),Oo.forEach(t);for(var a=0;a<Sr.length;a++){var r=Sr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sr.length&&(a=Sr[0],a.blockedOn===null);)Jb(a),a.blockedOn===null&&Sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[Pt]||null;if(typeof n=="function")o||uh(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[Pt]||null)l=o.formAction;else if(cd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),uh(a)}}}function Ib(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function ud(e){this._internalRoot=e}js.prototype.render=ud.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,r=sa();Zb(a,r,e,t,null,null)};js.prototype.unmount=ud.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zb(e.current,2,null,e,null,null),Bs(),t[bn]=null}};function js(e){this._internalRoot=e}js.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ch();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Sr.length&&t!==0&&t<Sr[a].priority;a++);Sr.splice(a,0,e),a===0&&Jb(e)}};var ph=dh.version;if(ph!=="19.2.3")throw Error(B(527,ph,"19.2.3"));Oe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=w0(t),e=e!==null?gh(e):null,e=e===null?null:e.stateNode,e};var Q1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ro=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ro.isDisabled&&ro.supportsFiber))try{Lo=ro.inject(Q1),oa=ro}catch{}var ro;Qs.createRoot=function(e,t){if(!mh(e))throw Error(B(299));var a=!1,r="",i=Gg,n=Yg,o=Xg;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Vb(e,1,!1,null,null,a,r,null,i,n,o,Ib),e[bn]=t.current,id(e),new ud(t)};Qs.hydrateRoot=function(e,t,a){if(!mh(e))throw Error(B(299));var r=!1,i="",n=Gg,o=Yg,l=Xg,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Vb(e,1,!0,t,a??null,r,i,c,n,o,l,Ib),t.context=$b(null),a=t.current,r=sa(),r=wp(r),i=Rr(r),i.callback=null,Ur(a,i,r),a=r,t.current.lanes=a,jo(t,a),ja(t),e[bn]=t.current,id(e),new js(t)};Qs.version="19.2.3"});var tw=Ra((Sx,ew)=>{"use strict";function Wb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wb)}catch(e){console.error(e)}}Wb(),ew.exports=Fb()});var $w=Ra(Vs=>{"use strict";var P1=Symbol.for("react.transitional.element"),J1=Symbol.for("react.fragment");function Vw(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:P1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Vs.Fragment=J1;Vs.jsx=Vw;Vs.jsxs=Vw});var ee=Ra((Fk,Zw)=>{"use strict";Zw.exports=$w()});var jv=Y(tw());var aw=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
8
+ `+r.stack}}var zu=Object.prototype.hasOwnProperty,_p=wt.unstable_scheduleCallback,Kc=wt.unstable_cancelCallback,A0=wt.unstable_shouldYield,R0=wt.unstable_requestPaint,na=wt.unstable_now,U0=wt.unstable_getCurrentPriorityLevel,Sh=wt.unstable_ImmediatePriority,Ch=wt.unstable_UserBlockingPriority,es=wt.unstable_NormalPriority,D0=wt.unstable_LowPriority,qh=wt.unstable_IdlePriority,O0=wt.log,B0=wt.unstable_setDisableYieldValue,Ho=null,oa=null;function Cr(e){if(typeof O0=="function"&&B0(e),oa&&typeof oa.setStrictMode=="function")try{oa.setStrictMode(Ho,e)}catch{}}var la=Math.clz32?Math.clz32:j0,L0=Math.log,H0=Math.LN2;function j0(e){return e>>>=0,e===0?32:31-(L0(e)/H0|0)|0}var vl=256,yl=262144,_l=4194304;function Wr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Cs(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=Wr(r):(o&=l,o!==0?i=Wr(o):a||(a=l&~e,a!==0&&(i=Wr(a))))):(l=r&~n,l!==0?i=Wr(l):o!==0?i=Wr(o):a||(a=r&~e,a!==0&&(i=Wr(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function jo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Q0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Eh(){var e=_l;return _l<<=1,(_l&62914560)===0&&(_l=4194304),e}function Pc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function G0(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var d=31-la(a),g=1<<d;l[d]=0,c[d]=-1;var m=p[d];if(m!==null)for(p[d]=null,d=0;d<m.length;d++){var b=m[d];b!==null&&(b.lane&=-536870913)}a&=~g}r!==0&&Mh(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function Mh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-la(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Th(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-la(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function zh(e,t){var a=t&-t;return a=(a&42)!==0?1:xp(a),(a&(e.suspendedLanes|t))!==0?0:a}function xp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function kp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ah(){var e=De.p;return e!==0?e:(e=window.event,e===void 0?32:tw(e.type))}function Jm(e,t){var a=De.p;try{return De.p=e,t()}finally{De.p=a}}var Xr=Math.random().toString(36).slice(2),Et="__reactFiber$"+Xr,Pt="__reactProps$"+Xr,bn="__reactContainer$"+Xr,Au="__reactEvents$"+Xr,Y0="__reactListeners$"+Xr,X0="__reactHandles$"+Xr,Im="__reactResources$"+Xr,Go="__reactMarker$"+Xr;function Np(e){delete e[Et],delete e[Pt],delete e[Au],delete e[Y0],delete e[X0]}function Gi(e){var t=e[Et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[Et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=oh(e);e!==null;){if(a=e[Et])return a;e=oh(e)}return t}e=a,a=e.parentNode}return null}function wn(e){if(e=e[Et]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(O(33))}function Fi(e){var t=e[Im];return t||(t=e[Im]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Go]=!0}var Rh=new Set,Uh={};function di(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(Uh[e]=t,e=0;e<t.length;e++)Rh.add(t[e])}var V0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fm={},Wm={};function $0(e){return zu.call(Wm,e)?!0:zu.call(Fm,e)?!1:V0.test(e)?Wm[e]=!0:(Fm[e]=!0,!1)}function Ol(e,t,a){if($0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function xl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Za(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ma(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ru(e){if(!e._valueTracker){var t=Dh(e)?"checked":"value";e._valueTracker=Z0(e,t,""+e[t])}}function Oh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Dh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ts(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var K0=/[\n"\\]/g;function ga(e){return e.replace(K0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Uu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ma(t)):e.value!==""+ma(t)&&(e.value=""+ma(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Du(e,o,ma(t)):a!=null?Du(e,o,ma(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function Bh(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Ru(e);return}a=a!=null?""+ma(a):"",t=t!=null?""+ma(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Ru(e)}function Du(e,t,a){t==="number"&&ts(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Wi(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lh(e,t,a){if(t!=null&&(t=""+ma(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ma(a):""}function Hh(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(O(92));if(oo(r)){if(1<r.length)throw Error(O(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ma(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Ru(e)}function sn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var P0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ef(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||P0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function jh(e,t,a){if(t!=null&&typeof t!="object")throw Error(O(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&ef(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&ef(e,n,t[n])}function Sp(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var J0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),I0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bl(e){return I0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tr(){}var Ou=null;function Cp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,en=null;function tf(e){var t=wn(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Uu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ga(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[Pt]||null;if(!i)throw Error(O(90));Uu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Oh(r)}break e;case"textarea":Lh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Wi(e,!!a.multiple,t,!1)}}}var Jc=!1;function Qh(e,t,a){if(Jc)return e(t,a);Jc=!0;try{var r=e(t);return r}finally{if(Jc=!1,(Yi!==null||en!==null)&&(Ls(),Yi&&(t=Yi,e=en,en=Yi=null,tf(t),e)))for(t=0;t<e.length;t++)tf(e[t])}}function So(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(O(231,t,typeof a));return a}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bu=!1;if(or)try{Di={},Object.defineProperty(Di,"passive",{get:function(){Bu=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Bu=!1}var Di,qr=null,qp=null,Ll=null;function Gh(){if(Ll)return Ll;var e,t=qp,a=t.length,r,i="value"in qr?qr.value:qr.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return Ll=i.slice(e,1<r?1-r:void 0)}function Hl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kl(){return!0}function af(){return!1}function Jt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?kl:af,this.isPropagationStopped=af,this}return et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Jt(mi),Yo=et({},mi,{view:0,detail:0}),F0=Jt(Yo),Ic,Fc,Wn,Es=et({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ep,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wn&&(Wn&&e.type==="mousemove"?(Ic=e.screenX-Wn.screenX,Fc=e.screenY-Wn.screenY):Fc=Ic=0,Wn=e),Ic)},movementY:function(e){return"movementY"in e?e.movementY:Fc}}),rf=Jt(Es),W0=et({},Es,{dataTransfer:0}),ey=Jt(W0),ty=et({},Yo,{relatedTarget:0}),Wc=Jt(ty),ay=et({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),ry=Jt(ay),iy=et({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ny=Jt(iy),oy=et({},mi,{data:0}),nf=Jt(oy),ly={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cy[e])?!!t[e]:!1}function Ep(){return uy}var py=et({},Yo,{key:function(e){if(e.key){var t=ly[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ep,charCode:function(e){return e.type==="keypress"?Hl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dy=Jt(py),my=et({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),of=Jt(my),fy=et({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ep}),hy=Jt(fy),gy=et({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),by=Jt(gy),wy=et({},Es,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),vy=Jt(wy),yy=et({},mi,{newState:0,oldState:0}),_y=Jt(yy),xy=[9,13,27,32],Mp=or&&"CompositionEvent"in window,uo=null;or&&"documentMode"in document&&(uo=document.documentMode);var ky=or&&"TextEvent"in window&&!uo,Yh=or&&(!Mp||uo&&8<uo&&11>=uo),lf=" ",sf=!1;function Xh(e,t){switch(e){case"keyup":return xy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function Ny(e,t){switch(e){case"compositionend":return Vh(t);case"keypress":return t.which!==32?null:(sf=!0,lf);case"textInput":return e=t.data,e===lf&&sf?null:e;default:return null}}function Sy(e,t){if(Xi)return e==="compositionend"||!Mp&&Xh(e,t)?(e=Gh(),Ll=qp=qr=null,Xi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Yh&&t.locale!=="ko"?null:t.data;default:return null}}var Cy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cy[e.type]:t==="textarea"}function $h(e,t,a,r){Yi?en?en.push(r):en=[r]:Yi=r,t=vs(t,"onChange"),0<t.length&&(a=new qs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var po=null,Co=null;function qy(e){Qb(e,0)}function Ms(e){var t=lo(e);if(Oh(t))return e}function uf(e,t){if(e==="change")return t}var Zh=!1;or&&(or?(Sl="oninput"in document,Sl||(eu=document.createElement("div"),eu.setAttribute("oninput","return;"),Sl=typeof eu.oninput=="function"),Nl=Sl):Nl=!1,Zh=Nl&&(!document.documentMode||9<document.documentMode));var Nl,Sl,eu;function pf(){po&&(po.detachEvent("onpropertychange",Kh),Co=po=null)}function Kh(e){if(e.propertyName==="value"&&Ms(Co)){var t=[];$h(t,Co,e,Cp(e)),Qh(qy,t)}}function Ey(e,t,a){e==="focusin"?(pf(),po=t,Co=a,po.attachEvent("onpropertychange",Kh)):e==="focusout"&&pf()}function My(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(Co)}function Ty(e,t){if(e==="click")return Ms(t)}function zy(e,t){if(e==="input"||e==="change")return Ms(t)}function Ay(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ca=typeof Object.is=="function"?Object.is:Ay;function qo(e,t){if(ca(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!zu.call(t,i)||!ca(e[i],t[i]))return!1}return!0}function df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mf(e,t){var a=df(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=df(a)}}function Ph(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ph(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ts(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ts(e.document)}return t}function Tp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ry=or&&"documentMode"in document&&11>=document.documentMode,Vi=null,Lu=null,mo=null,Hu=!1;function ff(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Hu||Vi==null||Vi!==ts(r)||(r=Vi,"selectionStart"in r&&Tp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mo&&qo(mo,r)||(mo=r,r=vs(Lu,"onSelect"),0<r.length&&(t=new qs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Vi)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},tu={},Ih={};or&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function fi(e){if(tu[e])return tu[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ih)return tu[e]=t[a];return e}var Fh=fi("animationend"),Wh=fi("animationiteration"),eg=fi("animationstart"),Uy=fi("transitionrun"),Dy=fi("transitionstart"),Oy=fi("transitioncancel"),tg=fi("transitionend"),ag=new Map,ju="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ju.push("scrollEnd");function Ta(e,t){ag.set(e,t),di(t,[e])}var as=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},da=[],Zi=0,zp=0;function Ts(){for(var e=Zi,t=zp=Zi=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var i=da[t];da[t++]=null;var n=da[t];if(da[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&rg(a,i,n)}}function zs(e,t,a,r){da[Zi++]=e,da[Zi++]=t,da[Zi++]=a,da[Zi++]=r,zp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ap(e,t,a,r){return zs(e,t,a,r),rs(e)}function hi(e,t){return zs(e,null,null,t),rs(e)}function rg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-la(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function rs(e){if(50<xo)throw xo=0,lp=null,Error(O(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function By(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,a,r){return new By(e,t,a,r)}function Rp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rr(e,t){var a=e.alternate;return a===null?(a=ra(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ig(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function jl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Rp(e)&&(o=1);else if(typeof e=="string")o=j1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case qu:return e=ra(31,a,t,i),e.elementType=qu,e.lanes=n,e;case ji:return ri(a.children,i,n,t);case kh:o=8,i|=24;break;case Nu:return e=ra(12,a,t,i|2),e.elementType=Nu,e.lanes=n,e;case Su:return e=ra(13,a,t,i),e.elementType=Su,e.lanes=n,e;case Cu:return e=ra(19,a,t,i),e.elementType=Cu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case er:o=10;break e;case Nh:o=9;break e;case vp:o=11;break e;case yp:o=14;break e;case yr:o=16,r=null;break e}o=29,a=Error(O(130,e===null?"null":typeof e,"")),r=null}return t=ra(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ri(e,t,a,r){return e=ra(7,e,r,t),e.lanes=a,e}function au(e,t,a){return e=ra(6,e,null,t),e.lanes=a,e}function ng(e){var t=ra(18,null,null,0);return t.stateNode=e,t}function ru(e,t,a){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hf=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=hf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Pm(t)},hf.set(e,t),t)}return{value:e,source:t,stack:Pm(t)}}var Pi=[],Ji=0,is=null,Eo=0,fa=[],ha=0,jr=null,Da=1,Oa="";function Fa(e,t){Pi[Ji++]=Eo,Pi[Ji++]=is,is=e,Eo=t}function og(e,t,a){fa[ha++]=Da,fa[ha++]=Oa,fa[ha++]=jr,jr=e;var r=Da;e=Oa;var i=32-la(r)-1;r&=~(1<<i),a+=1;var n=32-la(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Da=1<<32-la(t)+i|a<<i|r,Oa=n+e}else Da=1<<n|a<<i|r,Oa=e}function Up(e){e.return!==null&&(Fa(e,1),og(e,1,0))}function Dp(e){for(;e===is;)is=Pi[--Ji],Pi[Ji]=null,Eo=Pi[--Ji],Pi[Ji]=null;for(;e===jr;)jr=fa[--ha],fa[ha]=null,Oa=fa[--ha],fa[ha]=null,Da=fa[--ha],fa[ha]=null}function lg(e,t){fa[ha++]=Da,fa[ha++]=Oa,fa[ha++]=jr,Da=t.id,Oa=t.overflow,jr=e}var Mt=null,We=null,Ee=!1,Ar=null,wa=!1,Qu=Error(O(519));function Qr(e){var t=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mo(ba(t,e)),Qu}function gf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Pt]=r,a){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(a=0;a<Ro.length;a++)Se(Ro[a],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),Bh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Hh(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Yb(t.textContent,a)?(r.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),r.onScroll!=null&&Se("scroll",t),r.onScrollEnd!=null&&Se("scrollend",t),r.onClick!=null&&(t.onclick=tr),t=!0):t=!1,t||Qr(e,!0)}function bf(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:Mt=Mt.return}}function Oi(e){if(e!==Mt)return!1;if(!Ee)return bf(e),Ee=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||dp(e.type,e.memoizedProps)),a=!a),a&&We&&Qr(e),bf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));We=nh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));We=nh(e)}else t===27?(t=We,Vr(e.type)?(e=gp,gp=null,We=e):We=t):We=Mt?ya(e.stateNode.nextSibling):null;return!0}function li(){We=Mt=null,Ee=!1}function iu(){var e=Ar;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Ar=null),e}function Mo(e){Ar===null?Ar=[e]:Ar.push(e)}var Gu=Ha(null),gi=null,ar=null;function xr(e,t,a){Je(Gu,t._currentValue),t._currentValue=a}function ir(e){e._currentValue=Gu.current,kt(Gu)}function Yu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Xu(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Yu(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(O(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Yu(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function vn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(O(387));if(o=o.memoizedProps,o!==null){var l=i.type;ca(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===Il.current){if(o=i.alternate,o===null)throw Error(O(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Do):e=[Do])}i=i.return}e!==null&&Xu(t,e,a,r),t.flags|=262144}function ns(e){for(e=e.firstContext;e!==null;){if(!ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,ar=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return sg(gi,e)}function Cl(e,t){return gi===null&&si(e),sg(e,t)}function sg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ar===null){if(e===null)throw Error(O(308));ar=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ar=ar.next=t;return a}var Ly=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Hy=wt.unstable_scheduleCallback,jy=wt.unstable_NormalPriority,ft={$$typeof:er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Op(){return{controller:new Ly,data:new Map,refCount:0}}function Xo(e){e.refCount--,e.refCount===0&&Hy(jy,function(){e.controller.abort()})}var fo=null,Vu=0,cn=0,tn=null;function Qy(e,t){if(fo===null){var a=fo=[];Vu=0,cn=ld(),tn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Vu++,t.then(wf,wf),t}function wf(){if(--Vu===0&&fo!==null){tn!==null&&(tn.status="fulfilled");var e=fo;fo=null,cn=0,tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Gy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var vf=le.S;le.S=function(e,t){xb=na(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qy(e,t),vf!==null&&vf(e,t)};var ii=Ha(null);function Bp(){var e=ii.current;return e!==null?e:$e.pooledCache}function Ql(e,t){t===null?Je(ii,ii.current):Je(ii,t.pool)}function cg(){var e=Bp();return e===null?null:{parent:ft._currentValue,pool:e}}var yn=Error(O(460)),Lp=Error(O(474)),As=Error(O(542)),os={then:function(){}};function yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ug(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(tr,tr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xf(e),e;default:if(typeof t.status=="string")t.then(tr,tr);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(O(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xf(e),e}throw ni=t,yn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,yn):a}}var ni=null;function _f(){if(ni===null)throw Error(O(459));var e=ni;return ni=null,e}function xf(e){if(e===yn||e===As)throw Error(O(483))}var an=null,To=0;function ql(e){var t=To;return To+=1,an===null&&(an=[]),ug(an,e,t)}function eo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function El(e,t){throw t.$$typeof===E0?Error(O(525)):(e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pg(e){function t(f,u){if(e){var w=f.deletions;w===null?(f.deletions=[u],f.flags|=16):w.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=rr(f,u),f.index=0,f.sibling=null,f}function n(f,u,w){return f.index=w,e?(w=f.alternate,w!==null?(w=w.index,w<u?(f.flags|=67108866,u):w):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,w,v){return u===null||u.tag!==6?(u=au(w,f.mode,v),u.return=f,u):(u=i(u,w),u.return=f,u)}function c(f,u,w,v){var S=w.type;return S===ji?d(f,u,w.props.children,v,w.key):u!==null&&(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&ei(S)===u.type)?(u=i(u,w.props),eo(u,w),u.return=f,u):(u=jl(w.type,w.key,w.props,null,f.mode,v),eo(u,w),u.return=f,u)}function p(f,u,w,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==w.containerInfo||u.stateNode.implementation!==w.implementation?(u=ru(w,f.mode,v),u.return=f,u):(u=i(u,w.children||[]),u.return=f,u)}function d(f,u,w,v,S){return u===null||u.tag!==7?(u=ri(w,f.mode,v,S),u.return=f,u):(u=i(u,w),u.return=f,u)}function g(f,u,w){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=au(""+u,f.mode,w),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case wl:return w=jl(u.type,u.key,u.props,null,f.mode,w),eo(w,u),w.return=f,w;case no:return u=ru(u,f.mode,w),u.return=f,u;case yr:return u=ei(u),g(f,u,w)}if(oo(u)||Fn(u))return u=ri(u,f.mode,w,null),u.return=f,u;if(typeof u.then=="function")return g(f,ql(u),w);if(u.$$typeof===er)return g(f,Cl(f,u),w);El(f,u)}return null}function m(f,u,w,v){var S=u!==null?u.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return S!==null?null:l(f,u,""+w,v);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case wl:return w.key===S?c(f,u,w,v):null;case no:return w.key===S?p(f,u,w,v):null;case yr:return w=ei(w),m(f,u,w,v)}if(oo(w)||Fn(w))return S!==null?null:d(f,u,w,v,null);if(typeof w.then=="function")return m(f,u,ql(w),v);if(w.$$typeof===er)return m(f,u,Cl(f,w),v);El(f,w)}return null}function b(f,u,w,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(w)||null,l(u,f,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wl:return f=f.get(v.key===null?w:v.key)||null,c(u,f,v,S);case no:return f=f.get(v.key===null?w:v.key)||null,p(u,f,v,S);case yr:return v=ei(v),b(f,u,w,v,S)}if(oo(v)||Fn(v))return f=f.get(w)||null,d(u,f,v,S,null);if(typeof v.then=="function")return b(f,u,w,ql(v),S);if(v.$$typeof===er)return b(f,u,w,Cl(u,v),S);El(u,v)}return null}function y(f,u,w,v){for(var S=null,R=null,z=u,A=u=0,Q=null;z!==null&&A<w.length;A++){z.index>A?(Q=z,z=null):Q=z.sibling;var K=m(f,z,w[A],v);if(K===null){z===null&&(z=Q);break}e&&z&&K.alternate===null&&t(f,z),u=n(K,u,A),R===null?S=K:R.sibling=K,R=K,z=Q}if(A===w.length)return a(f,z),Ee&&Fa(f,A),S;if(z===null){for(;A<w.length;A++)z=g(f,w[A],v),z!==null&&(u=n(z,u,A),R===null?S=z:R.sibling=z,R=z);return Ee&&Fa(f,A),S}for(z=r(z);A<w.length;A++)Q=b(z,f,A,w[A],v),Q!==null&&(e&&Q.alternate!==null&&z.delete(Q.key===null?A:Q.key),u=n(Q,u,A),R===null?S=Q:R.sibling=Q,R=Q);return e&&z.forEach(function(me){return t(f,me)}),Ee&&Fa(f,A),S}function T(f,u,w,v){if(w==null)throw Error(O(151));for(var S=null,R=null,z=u,A=u=0,Q=null,K=w.next();z!==null&&!K.done;A++,K=w.next()){z.index>A?(Q=z,z=null):Q=z.sibling;var me=m(f,z,K.value,v);if(me===null){z===null&&(z=Q);break}e&&z&&me.alternate===null&&t(f,z),u=n(me,u,A),R===null?S=me:R.sibling=me,R=me,z=Q}if(K.done)return a(f,z),Ee&&Fa(f,A),S;if(z===null){for(;!K.done;A++,K=w.next())K=g(f,K.value,v),K!==null&&(u=n(K,u,A),R===null?S=K:R.sibling=K,R=K);return Ee&&Fa(f,A),S}for(z=r(z);!K.done;A++,K=w.next())K=b(z,f,A,K.value,v),K!==null&&(e&&K.alternate!==null&&z.delete(K.key===null?A:K.key),u=n(K,u,A),R===null?S=K:R.sibling=K,R=K);return e&&z.forEach(function(Re){return t(f,Re)}),Ee&&Fa(f,A),S}function D(f,u,w,v){if(typeof w=="object"&&w!==null&&w.type===ji&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case wl:e:{for(var S=w.key;u!==null;){if(u.key===S){if(S=w.type,S===ji){if(u.tag===7){a(f,u.sibling),v=i(u,w.props.children),v.return=f,f=v;break e}}else if(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===yr&&ei(S)===u.type){a(f,u.sibling),v=i(u,w.props),eo(v,w),v.return=f,f=v;break e}a(f,u);break}else t(f,u);u=u.sibling}w.type===ji?(v=ri(w.props.children,f.mode,v,w.key),v.return=f,f=v):(v=jl(w.type,w.key,w.props,null,f.mode,v),eo(v,w),v.return=f,f=v)}return o(f);case no:e:{for(S=w.key;u!==null;){if(u.key===S)if(u.tag===4&&u.stateNode.containerInfo===w.containerInfo&&u.stateNode.implementation===w.implementation){a(f,u.sibling),v=i(u,w.children||[]),v.return=f,f=v;break e}else{a(f,u);break}else t(f,u);u=u.sibling}v=ru(w,f.mode,v),v.return=f,f=v}return o(f);case yr:return w=ei(w),D(f,u,w,v)}if(oo(w))return y(f,u,w,v);if(Fn(w)){if(S=Fn(w),typeof S!="function")throw Error(O(150));return w=S.call(w),T(f,u,w,v)}if(typeof w.then=="function")return D(f,u,ql(w),v);if(w.$$typeof===er)return D(f,u,Cl(f,w),v);El(f,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,u!==null&&u.tag===6?(a(f,u.sibling),v=i(u,w),v.return=f,f=v):(a(f,u),v=au(w,f.mode,v),v.return=f,f=v),o(f)):a(f,u)}return function(f,u,w,v){try{To=0;var S=D(f,u,w,v);return an=null,S}catch(z){if(z===yn||z===As)throw z;var R=ra(29,z,null,f.mode);return R.lanes=v,R.return=f,R}}}var ci=pg(!0),dg=pg(!1),_r=!1;function Hp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ur(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ue&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=rs(e),rg(e,null,a),t}return zs(e,r,t,a),rs(e)}function ho(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Th(e,a)}}function nu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Zu=!1;function go(){if(Zu){var e=tn;if(e!==null)throw e}}function bo(e,t,a,r){Zu=!1;var i=e.updateQueue;_r=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=p:l.next=p,d.lastBaseUpdate=c))}if(n!==null){var g=i.baseState;o=0,d=p=c=null,l=n;do{var m=l.lane&-536870913,b=m!==l.lane;if(b?(qe&m)===m:(r&m)===m){m!==0&&m===cn&&(Zu=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var y=e,T=l;m=t;var D=a;switch(T.tag){case 1:if(y=T.payload,typeof y=="function"){g=y.call(D,g,m);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=T.payload,m=typeof y=="function"?y.call(D,g,m):y,m==null)break e;g=et({},g,m);break e;case 2:_r=!0}}m=l.callback,m!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[m]:b.push(m))}else b={lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(p=d=b,c=g):d=d.next=b,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);d===null&&(c=g),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=d,n===null&&(i.shared.lanes=0),Yr|=o,e.lanes=o,e.memoizedState=g}}function mg(e,t){if(typeof e!="function")throw Error(O(191,e));e.call(t)}function fg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)mg(a[e],t)}var un=Ha(null),ls=Ha(0);function kf(e,t){e=ur,Je(ls,e),Je(un,t),ur=e|t.baseLanes}function Ku(){Je(ls,ur),Je(un,un.current)}function jp(){ur=ls.current,kt(un),kt(ls)}var ua=Ha(null),va=null;function kr(e){var t=e.alternate;Je(st,st.current&1),Je(ua,e),va===null&&(t===null||un.current!==null||t.memoizedState!==null)&&(va=e)}function Pu(e){Je(st,st.current),Je(ua,e),va===null&&(va=e)}function hg(e){e.tag===22?(Je(st,st.current),Je(ua,e),va===null&&(va=e)):Nr(e)}function Nr(){Je(st,st.current),Je(ua,ua.current)}function aa(e){kt(ua),va===e&&(va=null),kt(st)}var st=Ha(0);function ss(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||fp(a)||hp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lr=0,fe=null,Xe=null,dt=null,cs=!1,rn=!1,ui=!1,us=0,zo=0,nn=null,Yy=0;function it(){throw Error(O(321))}function Qp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ca(e[a],t[a]))return!1;return!0}function Gp(e,t,a,r,i,n){return lr=n,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,le.H=e===null||e.memoizedState===null?$g:Wp,ui=!1,n=a(r,i),ui=!1,rn&&(n=bg(t,a,r,i)),gg(e),n}function gg(e){le.H=Ao;var t=Xe!==null&&Xe.next!==null;if(lr=0,dt=Xe=fe=null,cs=!1,zo=0,nn=null,t)throw Error(O(300));e===null||ht||(e=e.dependencies,e!==null&&ns(e)&&(ht=!0))}function bg(e,t,a,r){fe=e;var i=0;do{if(rn&&(nn=null),zo=0,rn=!1,25<=i)throw Error(O(301));if(i+=1,dt=Xe=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}le.H=Zg,n=t(a,r)}while(rn);return n}function Xy(){var e=le.H,t=e.useState()[0];return t=typeof t.then=="function"?Vo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(fe.flags|=1024),t}function Yp(){var e=us!==0;return us=0,e}function Xp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Vp(e){if(cs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cs=!1}lr=0,dt=Xe=fe=null,rn=!1,zo=us=0,nn=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?fe.memoizedState=dt=e:dt=dt.next=e,dt}function ct(){if(Xe===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=dt===null?fe.memoizedState:dt.next;if(t!==null)dt=t,Xe=e;else{if(e===null)throw fe.alternate===null?Error(O(467)):Error(O(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},dt===null?fe.memoizedState=dt=e:dt=dt.next=e}return dt}function Rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vo(e){var t=zo;return zo+=1,nn===null&&(nn=[]),e=ug(nn,e,t),t=fe,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,le.H=t===null||t.memoizedState===null?$g:Wp),e}function Us(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vo(e);if(e.$$typeof===er)return Tt(e)}throw Error(O(438,String(e)))}function $p(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Rs(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=M0;return t.index++,a}function sr(e,t){return typeof t=="function"?t(e):t}function Gl(e){var t=ct();return Zp(t,Xe,e)}function Zp(e,t,a){var r=e.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,d=!1;do{var g=p.lane&-536870913;if(g!==p.lane?(qe&g)===g:(lr&g)===g){var m=p.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),g===cn&&(d=!0);else if((lr&m)===m){p=p.next,m===cn&&(d=!0);continue}else g={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=g,o=n):c=c.next=g,fe.lanes|=m,Yr|=m;g=p.action,ui&&a(n,g),n=p.hasEagerState?p.eagerState:a(n,g)}else m={lane:g,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=m,o=n):c=c.next=m,fe.lanes|=g,Yr|=g;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!ca(n,e.memoizedState)&&(ht=!0,d&&(a=tn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ou(e){var t=ct(),a=t.queue;if(a===null)throw Error(O(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);ca(n,t.memoizedState)||(ht=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function wg(e,t,a){var r=fe,i=ct(),n=Ee;if(n){if(a===void 0)throw Error(O(407));a=a()}else a=t();var o=!ca((Xe||i).memoizedState,a);if(o&&(i.memoizedState=a,ht=!0),i=i.queue,Kp(_g.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||dt!==null&&dt.memoizedState.tag&1){if(r.flags|=2048,pn(9,{destroy:void 0},yg.bind(null,r,i,a,t),null),$e===null)throw Error(O(349));n||(lr&127)!==0||vg(r,t,a)}return a}function vg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=Rs(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function yg(e,t,a,r){t.value=a,t.getSnapshot=r,xg(t)&&kg(e)}function _g(e,t,a){return a(function(){xg(t)&&kg(e)})}function xg(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ca(e,a)}catch{return!0}}function kg(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function Ju(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Cr(!0);try{a()}finally{Cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:e},t}function Ng(e,t,a,r){return e.baseState=a,Zp(e,Xe,typeof r=="function"?r:sr)}function Vy(e,t,a,r,i){if(Os(e))throw Error(O(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};le.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,Sg(t,n)):(n.next=a.next,t.pending=a.next=n)}}function Sg(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=le.T,o={};le.T=o;try{var l=a(i,r),c=le.S;c!==null&&c(o,l),Nf(e,t,l)}catch(p){Iu(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),le.T=n}}else try{n=a(i,r),Nf(e,t,n)}catch(p){Iu(e,t,p)}}function Nf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Sf(e,t,r)},function(r){return Iu(e,t,r)}):Sf(e,t,a)}function Sf(e,t,a){t.status="fulfilled",t.value=a,Cg(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Sg(e,a)))}function Iu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Cg(t),t=t.next;while(t!==r)}e.action=null}function Cg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qg(e,t){return t}function Cf(e,t){if(Ee){var a=$e.formState;if(a!==null){e:{var r=fe;if(Ee){if(We){t:{for(var i=We,n=wa;i.nodeType!==8;){if(!n){i=null;break t}if(i=ya(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){We=ya(i.nextSibling),r=i.data==="F!";break e}}Qr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qg,lastRenderedState:t},a.queue=r,a=Yg.bind(null,fe,r),r.dispatch=a,r=Ju(!1),n=Fp.bind(null,fe,!1,r.queue),r=Ht(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=Vy.bind(null,fe,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function qf(e){var t=ct();return Eg(t,Xe,e)}function Eg(e,t,a){if(t=Zp(e,t,qg)[0],e=Gl(sr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Vo(t)}catch(o){throw o===yn?As:o}else r=t;t=ct();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,pn(9,{destroy:void 0},$y.bind(null,i,a),null)),[r,n,e]}function $y(e,t){e.action=t}function Ef(e){var t=ct(),a=Xe;if(a!==null)return Eg(t,a,e);ct(),t=t.memoizedState,a=ct();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function pn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=Rs(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function Mg(){return ct().memoizedState}function Yl(e,t,a,r){var i=Ht();fe.flags|=e,i.memoizedState=pn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Ds(e,t,a,r){var i=ct();r=r===void 0?null:r;var n=i.memoizedState.inst;Xe!==null&&r!==null&&Qp(r,Xe.memoizedState.deps)?i.memoizedState=pn(t,n,a,r):(fe.flags|=e,i.memoizedState=pn(1|t,n,a,r))}function Mf(e,t){Yl(8390656,8,e,t)}function Kp(e,t){Ds(2048,8,e,t)}function Zy(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=Rs(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Tg(e){var t=ct().memoizedState;return Zy({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(O(440));return t.impl.apply(void 0,arguments)}}function zg(e,t){return Ds(4,2,e,t)}function Ag(e,t){return Ds(4,4,e,t)}function Rg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ug(e,t,a){a=a!=null?a.concat([e]):null,Ds(4,4,Rg.bind(null,t,e),a)}function Pp(){}function Dg(e,t){var a=ct();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Qp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Og(e,t){var a=ct();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Qp(t,r[1]))return r[0];if(r=e(),ui){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r}function Jp(e,t,a){return a===void 0||(lr&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Nb(),fe.lanes|=e,Yr|=e,a)}function Bg(e,t,a,r){return ca(a,t)?a:un.current!==null?(e=Jp(e,a,r),ca(e,t)||(ht=!0),e):(lr&42)===0||(lr&1073741824)!==0&&(qe&261930)===0?(ht=!0,e.memoizedState=a):(e=Nb(),fe.lanes|=e,Yr|=e,t)}function Lg(e,t,a,r,i){var n=De.p;De.p=n!==0&&8>n?n:8;var o=le.T,l={};le.T=l,Fp(e,!1,t,a);try{var c=i(),p=le.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=Gy(c,r);wo(e,t,d,sa(e))}else wo(e,t,r,sa(e))}catch(g){wo(e,t,{then:function(){},status:"rejected",reason:g},sa())}finally{De.p=n,o!==null&&l.types!==null&&(o.types=l.types),le.T=o}}function Ky(){}function Fu(e,t,a,r){if(e.tag!==5)throw Error(O(476));var i=Hg(e).queue;Lg(e,i,t,ai,a===null?Ky:function(){return jg(e),a(r)})}function Hg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jg(e){var t=Hg(e);t.next===null&&(t=e.alternate.memoizedState),wo(e,t.next.queue,{},sa())}function Ip(){return Tt(Do)}function Qg(){return ct().memoizedState}function Gg(){return ct().memoizedState}function Py(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=sa();e=Rr(a);var r=Ur(t,e,a);r!==null&&(Kt(r,t,a),ho(r,t,a)),t={cache:Op()},e.payload=t;return}t=t.return}}function Jy(e,t,a){var r=sa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Os(e)?Xg(t,a):(a=Ap(e,t,a,r),a!==null&&(Kt(a,e,r),Vg(a,t,r)))}function Yg(e,t,a){var r=sa();wo(e,t,a,r)}function wo(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Os(e))Xg(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,ca(l,o))return zs(e,t,i,0),$e===null&&Ts(),!1}catch{}if(a=Ap(e,t,i,r),a!==null)return Kt(a,e,r),Vg(a,t,r),!0}return!1}function Fp(e,t,a,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(O(479))}else t=Ap(e,a,r,2),t!==null&&Kt(t,e,2)}function Os(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Xg(e,t){rn=cs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Vg(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Th(e,a)}}var Ao={readContext:Tt,use:Us,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};Ao.useEffectEvent=it;var $g={readContext:Tt,use:Us,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Mf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Yl(4194308,4,Rg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Yl(4194308,4,e,t)},useInsertionEffect:function(e,t){Yl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Cr(!0);try{e()}finally{Cr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var i=a(t);if(ui){Cr(!0);try{a(t)}finally{Cr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Jy.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Ju(e);var t=e.queue,a=Yg.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Pp,useDeferredValue:function(e,t){var a=Ht();return Jp(a,e,t)},useTransition:function(){var e=Ju(!1);return e=Lg.bind(null,fe,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,i=Ht();if(Ee){if(a===void 0)throw Error(O(407));a=a()}else{if(a=t(),$e===null)throw Error(O(349));(qe&127)!==0||vg(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,Mf(_g.bind(null,r,n,e),[e]),r.flags|=2048,pn(9,{destroy:void 0},yg.bind(null,r,n,a,t),null),a},useId:function(){var e=Ht(),t=$e.identifierPrefix;if(Ee){var a=Oa,r=Da;a=(r&~(1<<32-la(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Yy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ip,useFormState:Cf,useActionState:Cf,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Fp.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:$p,useCacheRefresh:function(){return Ht().memoizedState=Py.bind(null,fe)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Ue&2)!==0)throw Error(O(440));return a.impl.apply(void 0,arguments)}}},Wp={readContext:Tt,use:Us,useCallback:Dg,useContext:Tt,useEffect:Kp,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Ag,useMemo:Og,useReducer:Gl,useRef:Mg,useState:function(){return Gl(sr)},useDebugValue:Pp,useDeferredValue:function(e,t){var a=ct();return Bg(a,Xe.memoizedState,e,t)},useTransition:function(){var e=Gl(sr)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:Vo(e),t]},useSyncExternalStore:wg,useId:Qg,useHostTransitionStatus:Ip,useFormState:qf,useActionState:qf,useOptimistic:function(e,t){var a=ct();return Ng(a,Xe,e,t)},useMemoCache:$p,useCacheRefresh:Gg};Wp.useEffectEvent=Tg;var Zg={readContext:Tt,use:Us,useCallback:Dg,useContext:Tt,useEffect:Kp,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Ag,useMemo:Og,useReducer:ou,useRef:Mg,useState:function(){return ou(sr)},useDebugValue:Pp,useDeferredValue:function(e,t){var a=ct();return Xe===null?Jp(a,e,t):Bg(a,Xe.memoizedState,e,t)},useTransition:function(){var e=ou(sr)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:Vo(e),t]},useSyncExternalStore:wg,useId:Qg,useHostTransitionStatus:Ip,useFormState:Ef,useActionState:Ef,useOptimistic:function(e,t){var a=ct();return Xe!==null?Ng(a,Xe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:$p,useCacheRefresh:Gg};Zg.useEffectEvent=Tg;function lu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:et({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Wu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.payload=t,a!=null&&(i.callback=a),t=Ur(e,i,r),t!==null&&(Kt(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=sa(),i=Rr(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Ur(e,i,r),t!==null&&(Kt(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=sa(),r=Rr(a);r.tag=2,t!=null&&(r.callback=t),t=Ur(e,r,a),t!==null&&(Kt(t,e,a),ho(t,e,a))}};function Tf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!qo(a,r)||!qo(i,n):!0}function zf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Wu.enqueueReplaceState(t,t.state,null)}function pi(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=et({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Kg(e){as(e)}function Pg(e){console.error(e)}function Jg(e){as(e)}function ps(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Af(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function ep(e,t,a){return a=Rr(a),a.tag=3,a.payload={element:null},a.callback=function(){ps(e,t)},a}function Ig(e){return e=Rr(e),e.tag=3,e}function Fg(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){Af(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Af(t,a,r),typeof i!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Iy(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&vn(t,a,i,!0),a=ua.current,a!==null){switch(a.tag){case 31:case 13:return va===null?gs():a.alternate===null&&nt===0&&(nt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===os?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),wu(e,r,i)),!1;case 22:return a.flags|=65536,r===os?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),wu(e,r,i)),!1}throw Error(O(435,a.tag))}return wu(e,r,i),gs(),!1}if(Ee)return t=ua.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Qu&&(e=Error(O(422),{cause:r}),Mo(ba(e,a)))):(r!==Qu&&(t=Error(O(423),{cause:r}),Mo(ba(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ba(r,a),i=ep(e.stateNode,r,i),nu(e,i),nt!==4&&(nt=2)),!1;var n=Error(O(520),{cause:r});if(n=ba(n,a),_o===null?_o=[n]:_o.push(n),nt!==4&&(nt=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=ep(a.stateNode,r,e),nu(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Dr===null||!Dr.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Ig(i),Fg(i,e,a,r),nu(a,i),!1}a=a.return}while(a!==null);return!1}var ed=Error(O(461)),ht=!1;function qt(e,t,a,r){t.child=e===null?dg(t,null,a,r):ci(t,e.child,a,r)}function Rf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return si(t),r=Gp(e,t,a,o,n,i),l=Yp(),e!==null&&!ht?(Xp(e,t,i),cr(e,t,i)):(Ee&&l&&Up(t),t.flags|=1,qt(e,t,r,i),t.child)}function Uf(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Rp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,Wg(e,t,n,r,i)):(e=jl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!td(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:qo,a(o,r)&&e.ref===t.ref)return cr(e,t,i)}return t.flags|=1,e=rr(n,r),e.ref=t.ref,e.return=t,t.child=e}function Wg(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(qo(n,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=n,td(e,i))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,cr(e,t,i)}return tp(e,t,a,r,i)}function eb(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return Df(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ql(t,n!==null?n.cachePool:null),n!==null?kf(t,n):Ku(),hg(t);else return r=t.lanes=536870912,Df(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(Ql(t,n.cachePool),kf(t,n),Nr(t),t.memoizedState=null):(e!==null&&Ql(t,null),Ku(),Nr(t));return qt(e,t,i,a),t.child}function so(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Df(e,t,a,r,i){var n=Bp();return n=n===null?null:{parent:ft._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&Ql(t,null),Ku(),hg(t),e!==null&&vn(e,t,r,!0),t.childLanes=i,null}function Xl(e,t){return t=ds({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Of(e,t,a){return ci(t,e.child,null,a),e=Xl(t,t.pendingProps),e.flags|=2,aa(t),t.memoizedState=null,e}function Fy(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(r.mode==="hidden")return e=Xl(t,r),t.lanes=536870912,so(null,e);if(Pu(t),(e=We)?(e=$b(e,wa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=ng(e),a.return=t,t.child=a,Mt=t,We=null)):e=null,e===null)throw Qr(t);return t.lanes=536870912,null}return Xl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Pu(t),i)if(t.flags&256)t.flags&=-257,t=Of(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(O(558));else if(ht||vn(e,t,a,!1),i=(a&e.childLanes)!==0,ht||i){if(r=$e,r!==null&&(o=zh(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Kt(r,e,o),ed;gs(),t=Of(e,t,a)}else e=n.treeContext,We=ya(o.nextSibling),Mt=t,Ee=!0,Ar=null,wa=!1,e!==null&&lg(t,e),t=Xl(t,r),t.flags|=4096;return t}return e=rr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(O(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function tp(e,t,a,r,i){return si(t),a=Gp(e,t,a,r,void 0,i),r=Yp(),e!==null&&!ht?(Xp(e,t,i),cr(e,t,i)):(Ee&&r&&Up(t),t.flags|=1,qt(e,t,a,i),t.child)}function Bf(e,t,a,r,i,n){return si(t),t.updateQueue=null,a=bg(t,r,a,i),gg(e),r=Yp(),e!==null&&!ht?(Xp(e,t,n),cr(e,t,n)):(Ee&&r&&Up(t),t.flags|=1,qt(e,t,a,n),t.child)}function Lf(e,t,a,r,i){if(si(t),t.stateNode===null){var n=Ki,o=a.contextType;typeof o=="object"&&o!==null&&(n=Tt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Wu,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},Hp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Tt(o):Ki,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(lu(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&Wu.enqueueReplaceState(n,n.state,null),bo(t,r,n,i),go(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=pi(a,l);n.props=c;var p=n.context,d=a.contextType;o=Ki,typeof d=="object"&&d!==null&&(o=Tt(d));var g=a.getDerivedStateFromProps;d=typeof g=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&zf(t,n,r,o),_r=!1;var m=t.memoizedState;n.state=m,bo(t,r,n,i),go(),p=t.memoizedState,l||m!==p||_r?(typeof g=="function"&&(lu(t,a,g,r),p=t.memoizedState),(c=_r||Tf(t,a,c,r,m,p,o))?(d||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,$u(e,t),o=t.memoizedProps,d=pi(a,o),n.props=d,g=t.pendingProps,m=n.context,p=a.contextType,c=Ki,typeof p=="object"&&p!==null&&(c=Tt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==g||m!==c)&&zf(t,n,r,c),_r=!1,m=t.memoizedState,n.state=m,bo(t,r,n,i),go();var b=t.memoizedState;o!==g||m!==b||_r||e!==null&&e.dependencies!==null&&ns(e.dependencies)?(typeof l=="function"&&(lu(t,a,l,r),b=t.memoizedState),(d=_r||Tf(t,a,d,r,m,b,c)||e!==null&&e.dependencies!==null&&ns(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=d):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Vl(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,a,i)):qt(e,t,a,i),t.memoizedState=n.state,e=t.child):e=cr(e,t,i),e}function Hf(e,t,a,r){return li(),t.flags|=256,qt(e,t,a,r),t.child}var su={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cu(e){return{baseLanes:e,cachePool:cg()}}function uu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ia),e}function tb(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(i?kr(t):Nr(t),(e=We)?(e=$b(e,wa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jr!==null?{id:Da,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=ng(e),a.return=t,t.child=a,Mt=t,We=null)):e=null,e===null)throw Qr(t);return hp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(Nr(t),i=t.mode,l=ds({mode:"hidden",children:l},i),r=ri(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=cu(a),r.childLanes=uu(e,o,a),t.memoizedState=su,so(null,r)):(kr(t),ap(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(kr(t),t.flags&=-257,t=pu(e,t,a)):t.memoizedState!==null?(Nr(t),t.child=e.child,t.flags|=128,t=null):(Nr(t),l=r.fallback,i=t.mode,r=ds({mode:"visible",children:r.children},i),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=cu(a),r.childLanes=uu(e,o,a),t.memoizedState=su,t=so(null,r));else if(kr(t),hp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(O(419)),r.stack="",r.digest=o,Mo({value:r,source:null,stack:null}),t=pu(e,t,a)}else if(ht||vn(e,t,a,!1),o=(a&e.childLanes)!==0,ht||o){if(o=$e,o!==null&&(r=zh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),ed;fp(l)||gs(),t=pu(e,t,a)}else fp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,We=ya(l.nextSibling),Mt=t,Ee=!0,Ar=null,wa=!1,e!==null&&lg(t,e),t=ap(t,r.children),t.flags|=4096);return t}return i?(Nr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=rr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=rr(p,l):(l=ri(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,so(null,r),r=t.child,l=e.child.memoizedState,l===null?l=cu(a):(i=l.cachePool,i!==null?(c=ft._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=cg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=uu(e,o,a),t.memoizedState=su,so(e.child,r)):(kr(t),a=e.child,e=a.sibling,a=rr(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function ap(e,t){return t=ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ds(e,t){return e=ra(22,e,null,t),e.lanes=0,e}function pu(e,t,a){return ci(t,e.child,null,a),e=ap(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yu(e.return,t,a)}function du(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function ab(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=st.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Je(st,o),qt(e,t,r,a),r=Ee?Eo:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jf(e,a,t);else if(e.tag===19)jf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ss(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),du(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ss(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}du(t,!0,a,null,n,r);break;case"together":du(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function cr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(vn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,a=rr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=rr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function td(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ns(e)))}function Wy(e,t,a){switch(t.tag){case 3:Fl(t,t.stateNode.containerInfo),xr(t,ft,e.memoizedState.cache),li();break;case 27:case 5:Tu(t);break;case 4:Fl(t,t.stateNode.containerInfo);break;case 10:xr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Pu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(kr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?tb(e,t,a):(kr(t),e=cr(e,t,a),e!==null?e.sibling:null);kr(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(vn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return ab(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(st,st.current),r)break;return null;case 22:return t.lanes=0,eb(e,t,a,t.pendingProps);case 24:xr(t,ft,e.memoizedState.cache)}return cr(e,t,a)}function rb(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!td(e,a)&&(t.flags&128)===0)return ht=!1,Wy(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Ee&&(t.flags&1048576)!==0&&og(t,Eo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Rp(e)?(r=pi(e,r),t.tag=1,t=Lf(null,t,e,r,a)):(t.tag=0,t=tp(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===vp){t.tag=11,t=Rf(null,t,e,r,a);break e}else if(i===yp){t.tag=14,t=Uf(null,t,e,r,a);break e}}throw t=Eu(e)||e,Error(O(306,t,""))}}return t;case 0:return tp(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=pi(r,t.pendingProps),Lf(e,t,r,i,a);case 3:e:{if(Fl(t,t.stateNode.containerInfo),e===null)throw Error(O(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,$u(e,t),bo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,xr(t,ft,r),r!==n.cache&&Xu(t,[ft],a,!0),go(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Hf(e,t,r,a);break e}else if(r!==i){i=ba(Error(O(424)),t),Mo(i),t=Hf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,We=ya(e.firstChild),Mt=t,Ee=!0,Ar=null,wa=!0,a=dg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===i){t=cr(e,t,a);break e}qt(e,t,r,a)}t=t.child}return t;case 26:return Vl(e,t),e===null?(a=sh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ee||(a=t.type,e=t.pendingProps,r=ys(zr.current).createElement(a),r[Et]=t,r[Pt]=e,zt(r,a,e),xt(r),t.stateNode=r):t.memoizedState=sh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Tu(t),e===null&&Ee&&(r=t.stateNode=Zb(t.type,t.pendingProps,zr.current),Mt=t,wa=!0,i=We,Vr(t.type)?(gp=i,We=ya(r.firstChild)):We=i),qt(e,t,t.pendingProps.children,a),Vl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((i=r=We)&&(r=q1(r,t.type,t.pendingProps,wa),r!==null?(t.stateNode=r,Mt=t,We=ya(r.firstChild),wa=!1,i=!0):i=!1),i||Qr(t)),Tu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,dp(i,n)?r=null:o!==null&&dp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Gp(e,t,Xy,null,null,a),Do._currentValue=i),Vl(e,t),qt(e,t,r,a),t.child;case 6:return e===null&&Ee&&((e=a=We)&&(a=E1(a,t.pendingProps,wa),a!==null?(t.stateNode=a,Mt=t,We=null,e=!0):e=!1),e||Qr(t)),null;case 13:return tb(e,t,a);case 4:return Fl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):qt(e,t,r,a),t.child;case 11:return Rf(e,t,t.type,t.pendingProps,a);case 7:return qt(e,t,t.pendingProps,a),t.child;case 8:return qt(e,t,t.pendingProps.children,a),t.child;case 12:return qt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,xr(t,t.type,r.value),qt(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,si(t),i=Tt(i),r=r(i),t.flags|=1,qt(e,t,r,a),t.child;case 14:return Uf(e,t,t.type,t.pendingProps,a);case 15:return Wg(e,t,t.type,t.pendingProps,a);case 19:return ab(e,t,a);case 31:return Fy(e,t,a);case 22:return eb(e,t,a,t.pendingProps);case 24:return si(t),r=Tt(ft),e===null?(i=Bp(),i===null&&(i=$e,n=Op(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},Hp(t),xr(t,ft,i)):((e.lanes&a)!==0&&($u(e,t),bo(t,null,null,a),go()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),xr(t,ft,r)):(r=n.cache,xr(t,ft,r),r!==i.cache&&Xu(t,[ft],a,!0))),qt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(O(156,t.tag))}function Ka(e){e.flags|=4}function mu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(qb())e.flags|=8192;else throw ni=os,Lp}else e.flags&=-16777217}function Qf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Jb(t))if(qb())e.flags|=8192;else throw ni=os,Lp}function Ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Eh():536870912,e.lanes|=t,dn|=t)}function to(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function e1(e,t,a){var r=t.pendingProps;switch(Dp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ir(ft),on(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Ka(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,iu())),Fe(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Ka(t),n!==null?(Fe(t),Qf(t,n)):(Fe(t),mu(t,i,null,r,a))):n?n!==e.memoizedState?(Ka(t),Fe(t),Qf(t,n)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ka(t),Fe(t),mu(t,i,e,r,a)),null;case 27:if(Wl(t),a=zr.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return Fe(t),null}e=La.current,Oi(t)?gf(t,e):(e=Zb(i,r,a),t.stateNode=e,Ka(t))}return Fe(t),null;case 5:if(Wl(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return Fe(t),null}if(n=La.current,Oi(t))gf(t,n);else{var o=ys(zr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[Et]=t,n[Pt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(zt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ka(t)}}return Fe(t),mu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ka(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(e=zr.current,Oi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Mt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Et]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Yb(e.nodeValue,a)),e||Qr(t,!0)}else e=ys(e).createTextNode(r),e[Et]=t,t.stateNode=e}return Fe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),a!==null){if(e===null){if(!r)throw Error(O(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(557));e[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else a=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(aa(t),t):(aa(t),null);if((t.flags&128)!==0)throw Error(O(558))}return Fe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(O(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[Et]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else i=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(aa(t),t):(aa(t),null)}return aa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ml(t,t.updateQueue),Fe(t),null);case 4:return on(),e===null&&sd(t.stateNode.containerInfo),Fe(t),null;case 10:return ir(t.type),Fe(t),null;case 19:if(kt(st),r=t.memoizedState,r===null)return Fe(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)to(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=ss(e),n!==null){for(t.flags|=128,to(r,!1),e=n.updateQueue,t.updateQueue=e,Ml(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ig(a,e),a=a.sibling;return Je(st,st.current&1|2),Ee&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&na()>fs&&(t.flags|=128,i=!0,to(r,!1),t.lanes=4194304)}else{if(!i)if(e=ss(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ml(t,e),to(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Ee)return Fe(t),null}else 2*na()-r.renderingStartTime>fs&&a!==536870912&&(t.flags|=128,i=!0,to(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=na(),e.sibling=null,a=st.current,Je(st,i?a&1|2:a&1),Ee&&Fa(t,r.treeForkCount),e):(Fe(t),null);case 22:case 23:return aa(t),jp(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&Ml(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&kt(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ir(ft),Fe(t),null;case 25:return null;case 30:return null}throw Error(O(156,t.tag))}function t1(e,t){switch(Dp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(ft),on(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Wl(t),null;case 31:if(t.memoizedState!==null){if(aa(t),t.alternate===null)throw Error(O(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(st),null;case 4:return on(),null;case 10:return ir(t.type),null;case 22:case 23:return aa(t),jp(),e!==null&&kt(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(ft),null;case 25:return null;default:return null}}function ib(e,t){switch(Dp(t),t.tag){case 3:ir(ft),on();break;case 26:case 27:case 5:Wl(t);break;case 4:on();break;case 31:t.memoizedState!==null&&aa(t);break;case 13:aa(t);break;case 19:kt(st);break;case 10:ir(t.type);break;case 22:case 23:aa(t),jp(),e!==null&&kt(ii);break;case 24:ir(ft)}}function $o(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){He(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(d){He(i,c,d)}}}r=r.next}while(r!==n)}}catch(d){He(t,t.return,d)}}function nb(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{fg(t,a)}catch(r){He(e,e.return,r)}}}function ob(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){He(e,t,r)}}function vo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){He(e,t,i)}}function Ba(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){He(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){He(e,t,i)}else a.current=null}function lb(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){He(e,e.return,i)}}function fu(e,t,a){try{var r=e.stateNode;_1(r,e.type,a,t),r[Pt]=t}catch(i){He(e,e.return,i)}}function sb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vr(e.type)||e.tag===4}function hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rp(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=tr));else if(r!==4&&(r===27&&Vr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(rp(e,t,a),e=e.sibling;e!==null;)rp(e,t,a),e=e.sibling}function ms(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Vr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ms(e,t,a),e=e.sibling;e!==null;)ms(e,t,a),e=e.sibling}function cb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,r,a),t[Et]=e,t[Pt]=a}catch(n){He(e,e.return,n)}}var Wa=!1,mt=!1,gu=!1,Gf=typeof WeakSet=="function"?WeakSet:Set,_t=null;function a1(e,t){if(e=e.containerInfo,up=Ns,e=Jh(e),Tp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,d=0,g=e,m=null;t:for(;;){for(var b;g!==a||i!==0&&g.nodeType!==3||(l=o+i),g!==n||r!==0&&g.nodeType!==3||(c=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(b=g.firstChild)!==null;)m=g,g=b;for(;;){if(g===e)break t;if(m===a&&++p===i&&(l=o),m===n&&++d===r&&(c=o),(b=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(pp={focusedElem:e,selectionRange:a},Ns=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var y=pi(a.type,i);e=r.getSnapshotBeforeUpdate(y,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(T){He(a,a.return,T)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)mp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mp(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(O(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function ub(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ja(e,a),r&4&&$o(5,a);break;case 1:if(Ja(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){He(a,a.return,o)}else{var i=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){He(a,a.return,o)}}r&64&&nb(a),r&512&&vo(a,a.return);break;case 3:if(Ja(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{fg(e,t)}catch(o){He(a,a.return,o)}}break;case 27:t===null&&r&4&&cb(a);case 26:case 5:Ja(e,a),t===null&&r&4&&lb(a),r&512&&vo(a,a.return);break;case 12:Ja(e,a);break;case 31:Ja(e,a),r&4&&mb(e,a);break;case 13:Ja(e,a),r&4&&fb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=p1.bind(null,a),M1(e,a))));break;case 22:if(r=a.memoizedState!==null||Wa,!r){t=t!==null&&t.memoizedState!==null||mt,i=Wa;var n=mt;Wa=r,(mt=t)&&!n?Ia(e,a,(a.subtreeFlags&8772)!==0):Ja(e,a),Wa=i,mt=n}break;case 30:break;default:Ja(e,a)}}function pb(e){var t=e.alternate;t!==null&&(e.alternate=null,pb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Np(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var at=null,$t=!1;function Pa(e,t,a){for(a=a.child;a!==null;)db(e,t,a),a=a.sibling}function db(e,t,a){if(oa&&typeof oa.onCommitFiberUnmount=="function")try{oa.onCommitFiberUnmount(Ho,a)}catch{}switch(a.tag){case 26:mt||Ba(a,t),Pa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:mt||Ba(a,t);var r=at,i=$t;Vr(a.type)&&(at=a.stateNode,$t=!1),Pa(e,t,a),ko(a.stateNode),at=r,$t=i;break;case 5:mt||Ba(a,t);case 6:if(r=at,i=$t,at=null,Pa(e,t,a),at=r,$t=i,at!==null)if($t)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(n){He(a,t,n)}else try{at.removeChild(a.stateNode)}catch(n){He(a,t,n)}break;case 18:at!==null&&($t?(e=at,rh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),gn(e)):rh(at,a.stateNode));break;case 4:r=at,i=$t,at=a.stateNode.containerInfo,$t=!0,Pa(e,t,a),at=r,$t=i;break;case 0:case 11:case 14:case 15:Gr(2,a,t),mt||Gr(4,a,t),Pa(e,t,a);break;case 1:mt||(Ba(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&ob(a,t,r)),Pa(e,t,a);break;case 21:Pa(e,t,a);break;case 22:mt=(r=mt)||a.memoizedState!==null,Pa(e,t,a),mt=r;break;default:Pa(e,t,a)}}function mb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(a){He(t,t.return,a)}}}function fb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(a){He(t,t.return,a)}}function r1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gf),t;default:throw Error(O(435,e.tag))}}function Tl(e,t){var a=r1(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=d1.bind(null,e,r);r.then(i,i)}})}function Xt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Vr(l.type)){at=l.stateNode,$t=!1;break e}break;case 5:at=l.stateNode,$t=!1;break e;case 3:case 4:at=l.stateNode.containerInfo,$t=!0;break e}l=l.return}if(at===null)throw Error(O(160));db(n,o,i),at=null,$t=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hb(t,e),t=t.sibling}var Ma=null;function hb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(t,e),Vt(e),r&4&&(Gr(3,e,e.return),$o(3,e),Gr(5,e,e.return));break;case 1:Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),r&64&&Wa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=Ma;if(Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[Go]||n[Et]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),zt(n,r,a),n[Et]=e,xt(n),r=n;break e;case"link":var o=uh("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=uh("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),zt(n,r,a),i.head.appendChild(n);break;default:throw Error(O(468,r))}n[Et]=e,xt(n),r=n}e.stateNode=r}else ph(i,e.type,e.stateNode);else e.stateNode=ch(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?ph(i,e.type,e.stateNode):ch(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&fu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),a!==null&&r&4&&fu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Xt(t,e),Vt(e),r&512&&(mt||a===null||Ba(a,a.return)),e.flags&32){i=e.stateNode;try{sn(i,"")}catch(y){He(e,e.return,y)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,fu(e,i,a!==null?a.memoizedProps:i)),r&1024&&(gu=!0);break;case 6:if(Xt(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(O(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(y){He(e,e.return,y)}}break;case 3:if(Kl=null,i=Ma,Ma=_s(t.containerInfo),Xt(t,e),Ma=i,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{gn(t.containerInfo)}catch(y){He(e,e.return,y)}gu&&(gu=!1,gb(e));break;case 4:r=Ma,Ma=_s(e.stateNode.containerInfo),Xt(t,e),Vt(e),Ma=r;break;case 12:Xt(t,e),Vt(e);break;case 31:Xt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 13:Xt(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bs=na()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=Wa,d=mt;if(Wa=p||i,mt=d||c,Xt(t,e),mt=d,Wa=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||Wa||mt||ti(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var g=c.memoizedProps.style,m=g!=null&&g.hasOwnProperty("display")?g.display:null;l.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(y){He(c,c.return,y)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(y){He(c,c.return,y)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?ih(b,!0):ih(c.stateNode,!1)}catch(y){He(c,c.return,y)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Tl(e,a))));break;case 19:Xt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 30:break;case 21:break;default:Xt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(sb(r)){a=r;break}r=r.return}if(a==null)throw Error(O(160));switch(a.tag){case 27:var i=a.stateNode,n=hu(e);ms(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(sn(o,""),a.flags&=-33);var l=hu(e);ms(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=hu(e);rp(e,p,c);break;default:throw Error(O(161))}}catch(d){He(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ub(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gr(4,t,t.return),ti(t);break;case 1:Ba(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&ob(t,t.return,a),ti(t);break;case 27:ko(t.stateNode);case 26:case 5:Ba(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Ia(i,n,a),$o(4,n);break;case 1:if(Ia(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){He(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)mg(c[i],l)}catch(p){He(r,r.return,p)}}a&&o&64&&nb(n),vo(n,n.return);break;case 27:cb(n);case 26:case 5:Ia(i,n,a),a&&r===null&&o&4&&lb(n),vo(n,n.return);break;case 12:Ia(i,n,a);break;case 31:Ia(i,n,a),a&&o&4&&mb(i,n);break;case 13:Ia(i,n,a),a&&o&4&&fb(i,n);break;case 22:n.memoizedState===null&&Ia(i,n,a),vo(n,n.return);break;case 30:break;default:Ia(i,n,a)}t=t.sibling}}function ad(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Xo(a))}function rd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xo(e))}function Ea(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bb(e,t,a,r),t=t.sibling}function bb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,r),i&2048&&$o(9,t);break;case 1:Ea(e,t,a,r);break;case 3:Ea(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xo(e)));break;case 12:if(i&2048){Ea(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){He(t,t.return,c)}}else Ea(e,t,a,r);break;case 31:Ea(e,t,a,r);break;case 13:Ea(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ea(e,t,a,r):yo(e,t):n._visibility&2?Ea(e,t,a,r):(n._visibility|=2,Li(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&ad(o,t);break;case 24:Ea(e,t,a,r),i&2048&&rd(t.alternate,t);break;default:Ea(e,t,a,r)}}function Li(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Li(n,o,l,c,i),$o(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?Li(n,o,l,c,i):yo(n,o):(d._visibility|=2,Li(n,o,l,c,i)),i&&p&2048&&ad(o.alternate,o);break;case 24:Li(n,o,l,c,i),i&&p&2048&&rd(o.alternate,o);break;default:Li(n,o,l,c,i)}t=t.sibling}}function yo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:yo(a,r),i&2048&&ad(r.alternate,r);break;case 24:yo(a,r),i&2048&&rd(r.alternate,r);break;default:yo(a,r)}t=t.sibling}}var co=8192;function Bi(e,t,a){if(e.subtreeFlags&co)for(e=e.child;e!==null;)wb(e,t,a),e=e.sibling}function wb(e,t,a){switch(e.tag){case 26:Bi(e,t,a),e.flags&co&&e.memoizedState!==null&&Q1(a,Ma,e.memoizedState,e.memoizedProps);break;case 5:Bi(e,t,a);break;case 3:case 4:var r=Ma;Ma=_s(e.stateNode.containerInfo),Bi(e,t,a),Ma=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=co,co=16777216,Bi(e,t,a),co=r):Bi(e,t,a));break;default:Bi(e,t,a)}}function vb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ao(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,_b(r,e)}vb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yb(e),e=e.sibling}function yb(e){switch(e.tag){case 0:case 11:case 15:ao(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:ao(e);break;case 12:ao(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$l(e)):ao(e);break;default:ao(e)}}function $l(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];_t=r,_b(r,e)}vb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),$l(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,$l(t));break;default:$l(t)}e=e.sibling}}function _b(e,t){for(;_t!==null;){var a=_t;switch(a.tag){case 0:case 11:case 15:Gr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Xo(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,_t=r;else e:for(a=e;_t!==null;){r=_t;var i=r.sibling,n=r.return;if(pb(r),r===a){_t=null;break e}if(i!==null){i.return=n,_t=i;break e}_t=n}}}var i1={getCacheForType:function(e){var t=Tt(ft),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ft).controller.signal}},n1=typeof WeakMap=="function"?WeakMap:Map,Ue=0,$e=null,Ce=null,qe=0,Le=0,ta=null,Er=!1,_n=!1,id=!1,ur=0,nt=0,Yr=0,oi=0,nd=0,ia=0,dn=0,_o=null,Zt=null,ip=!1,Bs=0,xb=0,fs=1/0,hs=null,Dr=null,bt=0,Or=null,mn=null,nr=0,np=0,op=null,kb=null,xo=0,lp=null;function sa(){return(Ue&2)!==0&&qe!==0?qe&-qe:le.T!==null?ld():Ah()}function Nb(){if(ia===0)if((qe&536870912)===0||Ee){var e=yl;yl<<=1,(yl&3932160)===0&&(yl=262144),ia=e}else ia=536870912;return e=ua.current,e!==null&&(e.flags|=32),ia}function Kt(e,t,a){(e===$e&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(fn(e,0),Mr(e,qe,ia,!1)),Qo(e,a),((Ue&2)===0||e!==$e)&&(e===$e&&((Ue&2)===0&&(oi|=a),nt===4&&Mr(e,qe,ia,!1)),ja(e))}function Sb(e,t,a){if((Ue&6)!==0)throw Error(O(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||jo(e,t),i=r?s1(e,t):bu(e,t,!0),n=r;do{if(i===0){_n&&!r&&Mr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!o1(a)){i=bu(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=_o;var c=l.current.memoizedState.isDehydrated;if(c&&(fn(l,o).flags|=256),o=bu(l,o,!1),o!==2){if(id&&!c){l.errorRecoveryDisabledLanes|=n,oi|=n,i=4;break e}n=Zt,Zt=i,n!==null&&(Zt===null?Zt=n:Zt.push.apply(Zt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){fn(e,0),Mr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(O(345));case 4:if((t&4194048)!==t)break;case 6:Mr(r,t,ia,!Er);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((t&62914560)===t&&(i=Bs+300-na(),10<i)){if(Mr(r,t,ia,!Er),Cs(r,0,!0)!==0)break e;nr=t,r.timeoutHandle=Vb(Yf.bind(null,r,a,Zt,hs,ip,t,ia,oi,dn,Er,n,"Throttled",-0,0),i);break e}Yf(r,a,Zt,hs,ip,t,ia,oi,dn,Er,n,null,-0,0)}}break}while(!0);ja(e)}function Yf(e,t,a,r,i,n,o,l,c,p,d,g,m,b){if(e.timeoutHandle=-1,g=t.subtreeFlags,g&8192||(g&16785408)===16785408){g={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tr},wb(t,n,g);var y=(n&62914560)===n?Bs-na():(n&4194048)===n?xb-na():0;if(y=G1(g,y),y!==null){nr=n,e.cancelPendingCommit=y(Vf.bind(null,e,t,n,a,r,i,o,l,c,d,g,null,m,b)),Mr(e,n,o,!p);return}}Vf(e,t,n,a,r,i,o,l,c)}function o1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!ca(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mr(e,t,a,r){t&=~nd,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-la(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&Mh(e,a,t)}function Ls(){return(Ue&6)===0?(Zo(0,!1),!1):!0}function od(){if(Ce!==null){if(Le===0)var e=Ce.return;else e=Ce,ar=gi=null,Vp(e),an=null,To=0,e=Ce;for(;e!==null;)ib(e.alternate,e),e=e.return;Ce=null}}function fn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,N1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),nr=0,od(),$e=e,Ce=a=rr(e.current,null),qe=t,Le=0,ta=null,Er=!1,_n=jo(e,t),id=!1,dn=ia=nd=oi=Yr=nt=0,Zt=_o=null,ip=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-la(r),n=1<<i;t|=e[i],r&=~n}return ur=t,Ts(),a}function Cb(e,t){fe=null,le.H=Ao,t===yn||t===As?(t=_f(),Le=3):t===Lp?(t=_f(),Le=4):Le=t===ed?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Ce===null&&(nt=1,ps(e,ba(t,e.current)))}function qb(){var e=ua.current;return e===null?!0:(qe&4194048)===qe?va===null:(qe&62914560)===qe||(qe&536870912)!==0?e===va:!1}function Eb(){var e=le.H;return le.H=Ao,e===null?Ao:e}function Mb(){var e=le.A;return le.A=i1,e}function gs(){nt=4,Er||(qe&4194048)!==qe&&ua.current!==null||(_n=!0),(Yr&134217727)===0&&(oi&134217727)===0||$e===null||Mr($e,qe,ia,!1)}function bu(e,t,a){var r=Ue;Ue|=2;var i=Eb(),n=Mb();($e!==e||qe!==t)&&(hs=null,fn(e,t)),t=!1;var o=nt;e:do try{if(Le!==0&&Ce!==null){var l=Ce,c=ta;switch(Le){case 8:od(),o=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(t=!0);var p=Le;if(Le=0,ta=null,Ii(e,l,c,p),a&&_n){o=0;break e}break;default:p=Le,Le=0,ta=null,Ii(e,l,c,p)}}l1(),o=nt;break}catch(d){Cb(e,d)}while(!0);return t&&e.shellSuspendCounter++,ar=gi=null,Ue=r,le.H=i,le.A=n,Ce===null&&($e=null,qe=0,Ts()),o}function l1(){for(;Ce!==null;)Tb(Ce)}function s1(e,t){var a=Ue;Ue|=2;var r=Eb(),i=Mb();$e!==e||qe!==t?(hs=null,fs=na()+500,fn(e,t)):_n=jo(e,t);e:do try{if(Le!==0&&Ce!==null){t=Ce;var n=ta;t:switch(Le){case 1:Le=0,ta=null,Ii(e,t,n,1);break;case 2:case 9:if(yf(n)){Le=0,ta=null,Xf(t);break}t=function(){Le!==2&&Le!==9||$e!==e||(Le=7),ja(e)},n.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:yf(n)?(Le=0,ta=null,Xf(t)):(Le=0,ta=null,Ii(e,t,n,7));break;case 5:var o=null;switch(Ce.tag){case 26:o=Ce.memoizedState;case 5:case 27:var l=Ce;if(o?Jb(o):l.stateNode.complete){Le=0,ta=null;var c=l.sibling;if(c!==null)Ce=c;else{var p=l.return;p!==null?(Ce=p,Hs(p)):Ce=null}break t}}Le=0,ta=null,Ii(e,t,n,5);break;case 6:Le=0,ta=null,Ii(e,t,n,6);break;case 8:od(),nt=6;break e;default:throw Error(O(462))}}c1();break}catch(d){Cb(e,d)}while(!0);return ar=gi=null,le.H=r,le.A=i,Ue=a,Ce!==null?0:($e=null,qe=0,Ts(),nt)}function c1(){for(;Ce!==null&&!A0();)Tb(Ce)}function Tb(e){var t=rb(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?Hs(e):Ce=t}function Xf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Bf(a,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Bf(a,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:Vp(t);default:ib(a,t),t=Ce=ig(t,ur),t=rb(a,t,ur)}e.memoizedProps=e.pendingProps,t===null?Hs(e):Ce=t}function Ii(e,t,a,r){ar=gi=null,Vp(t),an=null,To=0;var i=t.return;try{if(Iy(e,i,t,a,qe)){nt=1,ps(e,ba(a,e.current)),Ce=null;return}}catch(n){if(i!==null)throw Ce=i,n;nt=1,ps(e,ba(a,e.current)),Ce=null;return}t.flags&32768?(Ee||r===1?e=!0:_n||(qe&536870912)!==0?e=!1:(Er=e=!0,(r===2||r===9||r===3||r===6)&&(r=ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),zb(t,e)):Hs(t)}function Hs(e){var t=e;do{if((t.flags&32768)!==0){zb(t,Er);return}e=t.return;var a=e1(t.alternate,t,ur);if(a!==null){Ce=a;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);nt===0&&(nt=5)}function zb(e,t){do{var a=t1(e.alternate,e);if(a!==null){a.flags&=32767,Ce=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=a}while(e!==null);nt=6,Ce=null}function Vf(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do js();while(bt!==0);if((Ue&6)!==0)throw Error(O(327));if(t!==null){if(t===e.current)throw Error(O(177));if(n=t.lanes|t.childLanes,n|=zp,G0(e,a,n,o,l,c),e===$e&&(Ce=$e=null,qe=0),mn=t,Or=e,nr=a,np=n,op=i,kb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,m1(es,function(){return Ob(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=le.T,le.T=null,i=De.p,De.p=2,o=Ue,Ue|=4;try{a1(e,t,a)}finally{Ue=o,De.p=i,le.T=r}}bt=1,Ab(),Rb(),Ub()}}function Ab(){if(bt===1){bt=0;var e=Or,t=mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=le.T,le.T=null;var r=De.p;De.p=2;var i=Ue;Ue|=4;try{hb(t,e);var n=pp,o=Jh(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&Ph(l.ownerDocument.documentElement,l)){if(c!==null&&Tp(l)){var p=c.start,d=c.end;if(d===void 0&&(d=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(d,l.value.length);else{var g=l.ownerDocument||document,m=g&&g.defaultView||window;if(m.getSelection){var b=m.getSelection(),y=l.textContent.length,T=Math.min(c.start,y),D=c.end===void 0?T:Math.min(c.end,y);!b.extend&&T>D&&(o=D,D=T,T=o);var f=mf(l,T),u=mf(l,D);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var w=g.createRange();w.setStart(f.node,f.offset),b.removeAllRanges(),T>D?(b.addRange(w),b.extend(u.node,u.offset)):(w.setEnd(u.node,u.offset),b.addRange(w))}}}}for(g=[],b=l;b=b.parentNode;)b.nodeType===1&&g.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<g.length;l++){var v=g[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Ns=!!up,pp=up=null}finally{Ue=i,De.p=r,le.T=a}}e.current=t,bt=2}}function Rb(){if(bt===2){bt=0;var e=Or,t=mn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=le.T,le.T=null;var r=De.p;De.p=2;var i=Ue;Ue|=4;try{ub(e,t.alternate,t)}finally{Ue=i,De.p=r,le.T=a}}bt=3}}function Ub(){if(bt===4||bt===3){bt=0,R0();var e=Or,t=mn,a=nr,r=kb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,mn=Or=null,Db(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Dr=null),kp(a),t=t.stateNode,oa&&typeof oa.onCommitFiberRoot=="function")try{oa.onCommitFiberRoot(Ho,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=le.T,i=De.p,De.p=2,le.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{le.T=t,De.p=i}}(nr&3)!==0&&js(),ja(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===lp?xo++:(xo=0,lp=e):xo=0,Zo(0,!1)}}function Db(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xo(t)))}function js(){return Ab(),Rb(),Ub(),Ob()}function Ob(){if(bt!==5)return!1;var e=Or,t=np;np=0;var a=kp(nr),r=le.T,i=De.p;try{De.p=32>a?32:a,le.T=null,a=op,op=null;var n=Or,o=nr;if(bt=0,mn=Or=null,nr=0,(Ue&6)!==0)throw Error(O(331));var l=Ue;if(Ue|=4,yb(n.current),bb(n,n.current,o,a),Ue=l,Zo(0,!1),oa&&typeof oa.onPostCommitFiberRoot=="function")try{oa.onPostCommitFiberRoot(Ho,n)}catch{}return!0}finally{De.p=i,le.T=r,Db(e,t)}}function $f(e,t,a){t=ba(a,t),t=ep(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(Qo(e,2),ja(e))}function He(e,t,a){if(e.tag===3)$f(e,e,a);else for(;t!==null;){if(t.tag===3){$f(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dr===null||!Dr.has(r))){e=ba(a,e),a=Ig(2),r=Ur(t,a,2),r!==null&&(Fg(a,r,t,e),Qo(r,2),ja(r));break}}t=t.return}}function wu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new n1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(id=!0,i.add(a),e=u1.bind(null,e,t,a),t.then(e,e))}function u1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(qe&a)===a&&(nt===4||nt===3&&(qe&62914560)===qe&&300>na()-Bs?(Ue&2)===0&&fn(e,0):nd|=a,dn===qe&&(dn=0)),ja(e)}function Bb(e,t){t===0&&(t=Eh()),e=hi(e,t),e!==null&&(Qo(e,t),ja(e))}function p1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Bb(e,a)}function d1(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(O(314))}r!==null&&r.delete(t),Bb(e,a)}function m1(e,t){return _p(e,t)}var bs=null,Hi=null,sp=!1,ws=!1,vu=!1,Tr=0;function ja(e){e!==Hi&&e.next===null&&(Hi===null?bs=Hi=e:Hi=Hi.next=e),ws=!0,sp||(sp=!0,h1())}function Zo(e,t){if(!vu&&ws){vu=!0;do for(var a=!1,r=bs;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-la(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Zf(r,n))}else n=qe,n=Cs(r,r===$e?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||jo(r,n)||(a=!0,Zf(r,n));r=r.next}while(a);vu=!1}}function f1(){Lb()}function Lb(){ws=sp=!1;var e=0;Tr!==0&&k1()&&(e=Tr);for(var t=na(),a=null,r=bs;r!==null;){var i=r.next,n=Hb(r,t);n===0?(r.next=null,a===null?bs=i:a.next=i,i===null&&(Hi=a)):(a=r,(e!==0||(n&3)!==0)&&(ws=!0)),r=i}bt!==0&&bt!==5||Zo(e,!1),Tr!==0&&(Tr=0)}function Hb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-la(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=Q0(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=$e,a=qe,a=Cs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Kc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||jo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Kc(r),kp(a)){case 2:case 8:a=Ch;break;case 32:a=es;break;case 268435456:a=qh;break;default:a=es}return r=jb.bind(null,e),a=_p(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Kc(r),e.callbackPriority=2,e.callbackNode=null,2}function jb(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(js()&&e.callbackNode!==a)return null;var r=qe;return r=Cs(e,e===$e?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Sb(e,r,t),Hb(e,na()),e.callbackNode!=null&&e.callbackNode===a?jb.bind(null,e):null)}function Zf(e,t){if(js())return null;Sb(e,t,!0)}function h1(){S1(function(){(Ue&6)!==0?_p(Sh,f1):Lb()})}function ld(){if(Tr===0){var e=cn;e===0&&(e=vl,vl<<=1,(vl&261888)===0&&(vl=256)),Tr=e}return Tr}function Kf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bl(""+e)}function Pf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function g1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=Kf((i[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?Kf(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new qs("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tr!==0){var c=o?Pf(i,o):new FormData(i);Fu(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?Pf(i,o):new FormData(i),Fu(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(zl=0;zl<ju.length;zl++)Al=ju[zl],Jf=Al.toLowerCase(),If=Al[0].toUpperCase()+Al.slice(1),Ta(Jf,"on"+If);var Al,Jf,If,zl;Ta(Fh,"onAnimationEnd");Ta(Wh,"onAnimationIteration");Ta(eg,"onAnimationStart");Ta("dblclick","onDoubleClick");Ta("focusin","onFocus");Ta("focusout","onBlur");Ta(Uy,"onTransitionRun");Ta(Dy,"onTransitionStart");Ta(Oy,"onTransitionCancel");Ta(tg,"onTransitionEnd");ln("onMouseEnter",["mouseout","mouseover"]);ln("onMouseLeave",["mouseout","mouseover"]);ln("onPointerEnter",["pointerout","pointerover"]);ln("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),b1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ro));function Qb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){as(d)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){as(d)}i.currentTarget=null,n=c}}}}function Se(e,t){var a=t[Au];a===void 0&&(a=t[Au]=new Set);var r=e+"__bubble";a.has(r)||(Gb(t,e,2,!1),a.add(r))}function yu(e,t,a){var r=0;t&&(r|=4),Gb(a,e,r,t)}var Rl="_reactListening"+Math.random().toString(36).slice(2);function sd(e){if(!e[Rl]){e[Rl]=!0,Rh.forEach(function(a){a!=="selectionchange"&&(b1.has(a)||yu(a,!1,e),yu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rl]||(t[Rl]=!0,yu("selectionchange",!1,t))}}function Gb(e,t,a,r){switch(tw(t)){case 2:var i=V1;break;case 8:i=$1;break;default:i=dd}a=i.bind(null,t,a,e),i=void 0,!Bu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function _u(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Qh(function(){var p=n,d=Cp(a),g=[];e:{var m=ag.get(e);if(m!==void 0){var b=qs,y=e;switch(e){case"keypress":if(Hl(a)===0)break e;case"keydown":case"keyup":b=dy;break;case"focusin":y="focus",b=Wc;break;case"focusout":y="blur",b=Wc;break;case"beforeblur":case"afterblur":b=Wc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=rf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=ey;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=hy;break;case Fh:case Wh:case eg:b=ry;break;case tg:b=by;break;case"scroll":case"scrollend":b=F0;break;case"wheel":b=vy;break;case"copy":case"cut":case"paste":b=ny;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=of;break;case"toggle":case"beforetoggle":b=_y}var T=(t&4)!==0,D=!T&&(e==="scroll"||e==="scrollend"),f=T?m!==null?m+"Capture":null:m;T=[];for(var u=p,w;u!==null;){var v=u;if(w=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||w===null||f===null||(v=So(u,f),v!=null&&T.push(Uo(u,v,w))),D)break;u=u.return}0<T.length&&(m=new b(m,y,null,a,d),g.push({event:m,listeners:T}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",m&&a!==Ou&&(y=a.relatedTarget||a.fromElement)&&(Gi(y)||y[bn]))break e;if((b||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,b?(y=a.relatedTarget||a.toElement,b=p,y=y?Gi(y):null,y!==null&&(D=Lo(y),T=y.tag,y!==D||T!==5&&T!==27&&T!==6)&&(y=null)):(b=null,y=p),b!==y)){if(T=rf,v="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(T=of,v="onPointerLeave",f="onPointerEnter",u="pointer"),D=b==null?m:lo(b),w=y==null?m:lo(y),m=new T(v,u+"leave",b,a,d),m.target=D,m.relatedTarget=w,v=null,Gi(d)===p&&(T=new T(f,u+"enter",y,a,d),T.target=w,T.relatedTarget=D,v=T),D=v,b&&y)t:{for(T=w1,f=b,u=y,w=0,v=f;v;v=T(v))w++;v=0;for(var S=u;S;S=T(S))v++;for(;0<w-v;)f=T(f),w--;for(;0<v-w;)u=T(u),v--;for(;w--;){if(f===u||u!==null&&f===u.alternate){T=f;break t}f=T(f),u=T(u)}T=null}else T=null;b!==null&&Ff(g,m,b,T,!1),y!==null&&D!==null&&Ff(g,D,y,T,!0)}}e:{if(m=p?lo(p):window,b=m.nodeName&&m.nodeName.toLowerCase(),b==="select"||b==="input"&&m.type==="file")var R=uf;else if(cf(m))if(Zh)R=zy;else{R=My;var z=Ey}else b=m.nodeName,!b||b.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?p&&Sp(p.elementType)&&(R=uf):R=Ty;if(R&&(R=R(e,p))){$h(g,R,a,d);break e}z&&z(e,m,p),e==="focusout"&&p&&m.type==="number"&&p.memoizedProps.value!=null&&Du(m,"number",m.value)}switch(z=p?lo(p):window,e){case"focusin":(cf(z)||z.contentEditable==="true")&&(Vi=z,Lu=p,mo=null);break;case"focusout":mo=Lu=Vi=null;break;case"mousedown":Hu=!0;break;case"contextmenu":case"mouseup":case"dragend":Hu=!1,ff(g,a,d);break;case"selectionchange":if(Ry)break;case"keydown":case"keyup":ff(g,a,d)}var A;if(Mp)e:{switch(e){case"compositionstart":var Q="onCompositionStart";break e;case"compositionend":Q="onCompositionEnd";break e;case"compositionupdate":Q="onCompositionUpdate";break e}Q=void 0}else Xi?Xh(e,a)&&(Q="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Q="onCompositionStart");Q&&(Yh&&a.locale!=="ko"&&(Xi||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&Xi&&(A=Gh()):(qr=d,qp="value"in qr?qr.value:qr.textContent,Xi=!0)),z=vs(p,Q),0<z.length&&(Q=new nf(Q,e,null,a,d),g.push({event:Q,listeners:z}),A?Q.data=A:(A=Vh(a),A!==null&&(Q.data=A)))),(A=ky?Ny(e,a):Sy(e,a))&&(Q=vs(p,"onBeforeInput"),0<Q.length&&(z=new nf("onBeforeInput","beforeinput",null,a,d),g.push({event:z,listeners:Q}),z.data=A)),g1(g,e,p,a,d)}Qb(g,t)})}function Uo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vs(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=So(e,a),i!=null&&r.unshift(Uo(e,i,n)),i=So(e,t),i!=null&&r.push(Uo(e,i,n))),e.tag===3)return r;e=e.return}return[]}function w1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ff(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=So(a,n),p!=null&&o.unshift(Uo(a,p,c))):i||(p=So(a,n),p!=null&&o.push(Uo(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var v1=/\r\n?/g,y1=/\u0000|\uFFFD/g;function Wf(e){return(typeof e=="string"?e:""+e).replace(v1,`
9
+ `).replace(y1,"")}function Yb(e,t){return t=Wf(t),Wf(e)===t}function Ye(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||sn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&sn(e,""+r);break;case"className":xl(e,"class",r);break;case"tabIndex":xl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":xl(e,a,r);break;case"style":jh(e,r,n);break;case"data":if(t!=="object"){xl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&Ye(e,t,"name",i.name,i,null),Ye(e,t,"formEncType",i.formEncType,i,null),Ye(e,t,"formMethod",i.formMethod,i,null),Ye(e,t,"formTarget",i.formTarget,i,null)):(Ye(e,t,"encType",i.encType,i,null),Ye(e,t,"method",i.method,i,null),Ye(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=tr);break;case"onScroll":r!=null&&Se("scroll",e);break;case"onScrollEnd":r!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Bl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Ol(e,"popover",r);break;case"xlinkActuate":Za(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Za(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Za(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Za(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Za(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Za(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Za(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Za(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Za(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ol(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=J0.get(a)||a,Ol(e,a,r))}}function cp(e,t,a,r,i,n){switch(a){case"style":jh(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"children":typeof r=="string"?sn(e,r):(typeof r=="number"||typeof r=="bigint")&&sn(e,""+r);break;case"onScroll":r!=null&&Se("scroll",e);break;case"onScrollEnd":r!=null&&Se("scrollend",e);break;case"onClick":r!=null&&(e.onclick=tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[Pt]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Ol(e,a,r)}}}function zt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,n,o,a,null)}}i&&Ye(e,t,"srcSet",a.srcSet,a,null),r&&Ye(e,t,"src",a.src,a,null);return;case"input":Se("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"name":i=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":p=d;break;case"value":n=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(O(137,t));break;default:Ye(e,t,r,d,a,null)}}Bh(e,n,l,c,p,o,i,!1);return;case"select":Se("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Ye(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?Wi(e,!!r,t,!1):a!=null&&Wi(e,!!r,a,!0);return;case"textarea":Se("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(O(91));break;default:Ye(e,t,o,l,a,null)}Hh(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ye(e,t,c,r,a,null));return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(r=0;r<Ro.length;r++)Se(Ro[r],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,p,r,a,null)}return;default:if(Sp(t)){for(d in a)a.hasOwnProperty(d)&&(r=a[d],r!==void 0&&cp(e,t,d,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&Ye(e,t,l,r,a,null))}function _1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,d=null;for(b in a){var g=a[b];if(a.hasOwnProperty(b)&&g!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=g;default:r.hasOwnProperty(b)||Ye(e,t,b,null,r,g)}}for(var m in r){var b=r[m];if(g=a[m],r.hasOwnProperty(m)&&(b!=null||g!=null))switch(m){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":d=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(O(137,t));break;default:b!==g&&Ye(e,t,m,b,r,g)}}Uu(e,o,l,c,p,d,n,i);return;case"select":b=o=l=m=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||Ye(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":m=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&Ye(e,t,i,n,r,c)}t=l,a=o,r=b,m!=null?Wi(e,!!a,m,!1):!!r!=!!a&&(t!=null?Wi(e,!!a,t,!0):Wi(e,!!a,a?[]:"",!1));return;case"textarea":b=m=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ye(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":m=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(O(91));break;default:i!==n&&Ye(e,t,o,i,r,n)}Lh(e,m,b);return;case"option":for(var y in a)m=a[y],a.hasOwnProperty(y)&&m!=null&&!r.hasOwnProperty(y)&&(y==="selected"?e.selected=!1:Ye(e,t,y,null,r,m));for(c in r)m=r[c],b=a[c],r.hasOwnProperty(c)&&m!==b&&(m!=null||b!=null)&&(c==="selected"?e.selected=m&&typeof m!="function"&&typeof m!="symbol":Ye(e,t,c,m,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var T in a)m=a[T],a.hasOwnProperty(T)&&m!=null&&!r.hasOwnProperty(T)&&Ye(e,t,T,null,r,m);for(p in r)if(m=r[p],b=a[p],r.hasOwnProperty(p)&&m!==b&&(m!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(O(137,t));break;default:Ye(e,t,p,m,r,b)}return;default:if(Sp(t)){for(var D in a)m=a[D],a.hasOwnProperty(D)&&m!==void 0&&!r.hasOwnProperty(D)&&cp(e,t,D,void 0,r,m);for(d in r)m=r[d],b=a[d],!r.hasOwnProperty(d)||m===b||m===void 0&&b===void 0||cp(e,t,d,m,r,b);return}}for(var f in a)m=a[f],a.hasOwnProperty(f)&&m!=null&&!r.hasOwnProperty(f)&&Ye(e,t,f,null,r,m);for(g in r)m=r[g],b=a[g],!r.hasOwnProperty(g)||m===b||m==null&&b==null||Ye(e,t,g,m,r,b)}function eh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&eh(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var d=c.transferSize,g=c.initiatorType;d&&eh(g)&&(c=c.responseEnd,o+=d*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var up=null,pp=null;function ys(e){return e.nodeType===9?e:e.ownerDocument}function th(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function dp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xu=null;function k1(){var e=window.event;return e&&e.type==="popstate"?e===xu?!1:(xu=e,!0):(xu=null,!1)}var Vb=typeof setTimeout=="function"?setTimeout:void 0,N1=typeof clearTimeout=="function"?clearTimeout:void 0,ah=typeof Promise=="function"?Promise:void 0,S1=typeof queueMicrotask=="function"?queueMicrotask:typeof ah<"u"?function(e){return ah.resolve(null).then(e).catch(C1)}:Vb;function C1(e){setTimeout(function(){throw e})}function Vr(e){return e==="head"}function rh(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),gn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ko(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ko(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[Go]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&ko(e.ownerDocument.body);a=i}while(a);gn(t)}function ih(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function mp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":mp(a),Np(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function q1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Go])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function E1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function $b(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function fp(e){return e.data==="$?"||e.data==="$~"}function hp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function M1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gp=null;function nh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function oh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Zb(e,t,a){switch(t=ys(a),e){case"html":if(e=t.documentElement,!e)throw Error(O(452));return e;case"head":if(e=t.head,!e)throw Error(O(453));return e;case"body":if(e=t.body,!e)throw Error(O(454));return e;default:throw Error(O(451))}}function ko(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Np(e)}var _a=new Map,lh=new Set;function _s(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pr=De.d;De.d={f:T1,r:z1,D:A1,C:R1,L:U1,m:D1,X:B1,S:O1,M:L1};function T1(){var e=pr.f(),t=Ls();return e||t}function z1(e){var t=wn(e);t!==null&&t.tag===5&&t.type==="form"?jg(t):pr.r(e)}var xn=typeof document>"u"?null:document;function Kb(e,t,a){var r=xn;if(r&&typeof t=="string"&&t){var i=ga(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),lh.has(i)||(lh.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function A1(e){pr.D(e),Kb("dns-prefetch",e,null)}function R1(e,t){pr.C(e,t),Kb("preconnect",e,t)}function U1(e,t,a){pr.L(e,t,a);var r=xn;if(r&&e&&t){var i='link[rel="preload"][as="'+ga(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ga(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ga(a.imageSizes)+'"]')):i+='[href="'+ga(e)+'"]';var n=i;switch(t){case"style":n=hn(e);break;case"script":n=kn(e)}_a.has(n)||(e=et({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Ko(n))||t==="script"&&r.querySelector(Po(n))||(t=r.createElement("link"),zt(t,"link",e),xt(t),r.head.appendChild(t)))}}function D1(e,t){pr.m(e,t);var a=xn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ga(r)+'"][href="'+ga(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=kn(e)}if(!_a.has(n)&&(e=et({rel:"modulepreload",href:e},t),_a.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Po(n)))return}r=a.createElement("link"),zt(r,"link",e),xt(r),a.head.appendChild(r)}}}function O1(e,t,a){pr.S(e,t,a);var r=xn;if(r&&e){var i=Fi(r).hoistableStyles,n=hn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Ko(n)))l.loading=5;else{e=et({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(n))&&cd(e,a);var c=o=r.createElement("link");xt(c),zt(c,"link",e),c._p=new Promise(function(p,d){c.onload=p,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Zl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function B1(e,t){pr.X(e,t);var a=xn;if(a&&e){var r=Fi(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Po(i)),n||(e=et({src:e,async:!0},t),(t=_a.get(i))&&ud(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function L1(e,t){pr.M(e,t);var a=xn;if(a&&e){var r=Fi(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Po(i)),n||(e=et({src:e,async:!0,type:"module"},t),(t=_a.get(i))&&ud(e,t),n=a.createElement("script"),xt(n),zt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function sh(e,t,a,r){var i=(i=zr.current)?_s(i):null;if(!i)throw Error(O(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=hn(a.href),a=Fi(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=hn(a.href);var n=Fi(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector(Ko(e)))&&!n._p&&(o.instance=n,o.state.loading=5),_a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_a.set(e,a),n||H1(i,e,a,o.state))),t&&r===null)throw Error(O(528,""));return o}if(t&&r!==null)throw Error(O(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kn(a),a=Fi(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,e))}}function hn(e){return'href="'+ga(e)+'"'}function Ko(e){return'link[rel="stylesheet"]['+e+"]"}function Pb(e){return et({},e,{"data-precedence":e.precedence,precedence:null})}function H1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),zt(t,"link",a),xt(t),e.head.appendChild(t))}function kn(e){return'[src="'+ga(e)+'"]'}function Po(e){return"script[async]"+e}function ch(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ga(a.href)+'"]');if(r)return t.instance=r,xt(r),r;var i=et({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),xt(r),zt(r,"style",i),Zl(r,a.precedence,e),t.instance=r;case"stylesheet":i=hn(a.href);var n=e.querySelector(Ko(i));if(n)return t.state.loading|=4,t.instance=n,xt(n),n;r=Pb(a),(i=_a.get(i))&&cd(r,i),n=(e.ownerDocument||e).createElement("link"),xt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),t.state.loading|=4,Zl(n,a.precedence,e),t.instance=n;case"script":return n=kn(a.src),(i=e.querySelector(Po(n)))?(t.instance=i,xt(i),i):(r=a,(i=_a.get(n))&&(r=et({},a),ud(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),xt(i),zt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(O(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Zl(r,a.precedence,e));return t.instance}function Zl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kl=null;function uh(e,t,a){if(Kl===null){var r=new Map,i=Kl=new Map;i.set(a,r)}else i=Kl,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[Go]||n[Et]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function ph(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function j1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Jb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Q1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=hn(r.href),n=t.querySelector(Ko(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,xt(n);return}n=t.ownerDocument||t,r=Pb(r),(i=_a.get(i))&&cd(r,i),n=n.createElement("link"),xt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),zt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=xs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var ku=0;function G1(e,t){return e.stylesheets&&e.count===0&&Pl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Pl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&ku===0&&(ku=62500*x1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>ku?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function xs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ks=null;function Pl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ks=new Map,t.forEach(Y1,e),ks=null,xs.call(e))}function Y1(e,t){if(!(t.state.loading&4)){var a=ks.get(e);if(a)var r=a.get(null);else{a=new Map,ks.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=xs.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Do={$$typeof:er,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function X1(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.hiddenUpdates=Pc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Ib(e,t,a,r,i,n,o,l,c,p,d,g){return e=new X1(e,t,a,o,c,p,d,g,l),t=1,n===!0&&(t|=24),n=ra(3,null,null,t),e.current=n,n.stateNode=e,t=Op(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},Hp(n),e}function Fb(e){return e?(e=Ki,e):Ki}function Wb(e,t,a,r,i,n){i=Fb(i),r.context===null?r.context=i:r.pendingContext=i,r=Rr(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Ur(e,r,t),a!==null&&(Kt(a,e,t),ho(a,e,t))}function dh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function pd(e,t){dh(e,t),(e=e.alternate)&&dh(e,t)}function ew(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),pd(e,67108864)}}function mh(e){if(e.tag===13||e.tag===31){var t=sa();t=xp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),pd(e,t)}}var Ns=!0;function V1(e,t,a,r){var i=le.T;le.T=null;var n=De.p;try{De.p=2,dd(e,t,a,r)}finally{De.p=n,le.T=i}}function $1(e,t,a,r){var i=le.T;le.T=null;var n=De.p;try{De.p=8,dd(e,t,a,r)}finally{De.p=n,le.T=i}}function dd(e,t,a,r){if(Ns){var i=bp(r);if(i===null)_u(e,t,r,Ss,a),fh(e,r);else if(K1(i,e,t,a,r))r.stopPropagation();else if(fh(e,r),t&4&&-1<Z1.indexOf(e)){for(;i!==null;){var n=wn(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Wr(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-la(o);l.entanglements[1]|=c,o&=~c}ja(n),(Ue&6)===0&&(fs=na()+500,Zo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Kt(l,n,2),Ls(),pd(n,2)}if(n=bp(r),n===null&&_u(e,t,r,Ss,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else _u(e,t,r,null,a)}}function bp(e){return e=Cp(e),md(e)}var Ss=null;function md(e){if(Ss=null,e=Gi(e),e!==null){var t=Lo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=yh(t),e!==null)return e;e=null}else if(a===31){if(e=_h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ss=e,null}function tw(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(U0()){case Sh:return 2;case Ch:return 8;case es:case D0:return 32;case qh:return 268435456;default:return 32}default:return 32}}var wp=!1,Br=null,Lr=null,Hr=null,Oo=new Map,Bo=new Map,Sr=[],Z1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function fh(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bo.delete(t.pointerId)}}function ro(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=wn(t),t!==null&&ew(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function K1(e,t,a,r,i){switch(t){case"focusin":return Br=ro(Br,e,t,a,r,i),!0;case"dragenter":return Lr=ro(Lr,e,t,a,r,i),!0;case"mouseover":return Hr=ro(Hr,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Oo.set(n,ro(Oo.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,Bo.set(n,ro(Bo.get(n)||null,e,t,a,r,i)),!0}return!1}function aw(e){var t=Gi(e.target);if(t!==null){var a=Lo(t);if(a!==null){if(t=a.tag,t===13){if(t=yh(a),t!==null){e.blockedOn=t,Jm(e.priority,function(){mh(a)});return}}else if(t===31){if(t=_h(a),t!==null){e.blockedOn=t,Jm(e.priority,function(){mh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=bp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Ou=r,a.target.dispatchEvent(r),Ou=null}else return t=wn(a),t!==null&&ew(t),e.blockedOn=a,!1;t.shift()}return!0}function hh(e,t,a){Jl(e)&&a.delete(t)}function P1(){wp=!1,Br!==null&&Jl(Br)&&(Br=null),Lr!==null&&Jl(Lr)&&(Lr=null),Hr!==null&&Jl(Hr)&&(Hr=null),Oo.forEach(hh),Bo.forEach(hh)}function Ul(e,t){e.blockedOn===t&&(e.blockedOn=null,wp||(wp=!0,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,P1)))}var Dl=null;function gh(e){Dl!==e&&(Dl=e,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,function(){Dl===e&&(Dl=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(md(r||a)===null)continue;break}var n=wn(a);n!==null&&(e.splice(t,3),t-=3,Fu(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function gn(e){function t(c){return Ul(c,e)}Br!==null&&Ul(Br,e),Lr!==null&&Ul(Lr,e),Hr!==null&&Ul(Hr,e),Oo.forEach(t),Bo.forEach(t);for(var a=0;a<Sr.length;a++){var r=Sr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sr.length&&(a=Sr[0],a.blockedOn===null);)aw(a),a.blockedOn===null&&Sr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[Pt]||null;if(typeof n=="function")o||gh(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[Pt]||null)l=o.formAction;else if(md(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),gh(a)}}}function rw(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function fd(e){this._internalRoot=e}Qs.prototype.render=fd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));var a=t.current,r=sa();Wb(a,r,e,t,null,null)};Qs.prototype.unmount=fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wb(e.current,2,null,e,null,null),Ls(),t[bn]=null}};function Qs(e){this._internalRoot=e}Qs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ah();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Sr.length&&t!==0&&t<Sr[a].priority;a++);Sr.splice(a,0,e),a===0&&aw(e)}};var bh=wh.version;if(bh!=="19.2.3")throw Error(O(527,bh,"19.2.3"));De.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=q0(t),e=e!==null?xh(e):null,e=e===null?null:e.stateNode,e};var J1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(io=__REACT_DEVTOOLS_GLOBAL_HOOK__,!io.isDisabled&&io.supportsFiber))try{Ho=io.inject(J1),oa=io}catch{}var io;Gs.createRoot=function(e,t){if(!vh(e))throw Error(O(299));var a=!1,r="",i=Kg,n=Pg,o=Jg;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ib(e,1,!1,null,null,a,r,null,i,n,o,rw),e[bn]=t.current,sd(e),new fd(t)};Gs.hydrateRoot=function(e,t,a){if(!vh(e))throw Error(O(299));var r=!1,i="",n=Kg,o=Pg,l=Jg,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Ib(e,1,!0,t,a??null,r,i,c,n,o,l,rw),t.context=Fb(null),a=t.current,r=sa(),r=xp(r),i=Rr(r),i.callback=null,Ur(a,i,r),a=r,t.current.lanes=a,Qo(t,a),ja(t),e[bn]=t.current,sd(e),new Qs(t)};Gs.version="19.2.3"});var lw=Ra((Ox,ow)=>{"use strict";function nw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nw)}catch(e){console.error(e)}}nw(),ow.exports=iw()});var Fw=Ra($s=>{"use strict";var i_=Symbol.for("react.transitional.element"),n_=Symbol.for("react.fragment");function Iw(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:i_,type:e,key:r,ref:t!==void 0?t:null,props:a}}$s.Fragment=n_;$s.jsx=Iw;$s.jsxs=Iw});var ee=Ra((c2,Ww)=>{"use strict";Ww.exports=Fw()});var Pv=Y(lw());var sw=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
10
10
  the host page. Start new selectors with :where(.app-wrapper), which scopes without
11
11
  adding specificity, or with .app-wrapper for rules on the root itself. */
12
12
 
@@ -6967,11 +6967,11 @@ Error generating stack: `+r.message+`
6967
6967
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
6968
6968
  }
6969
6969
  }
6970
- `;var Le=Y(Ye());var Gs={};function rw(e){Gs={...e,client:e.client?.trim().toUpperCase()||void 0}}function jt(){return Gs}function pd(){return!!Gs.apiBaseUrl}var Y1=e=>e.replace(/\/$/,"");function za(e){let t=Gs.apiBaseUrl;return t?`${Y1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Nn=Y(Ye());var X1="metron:step",V1="metron_step",Po=(0,Nn.createContext)(()=>{}),Sn=()=>(0,Nn.useContext)(Po);function Ys(e,t){return(0,Nn.useCallback)((a,r={})=>{let i=jt(),n=i.analytics??"all";if(n==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(X1,{detail:o,bubbles:!0,composed:!0})),i.onEvent?.(o);let l=window.dataLayer;n==="all"&&Array.isArray(l)&&l.push({event:V1,...o})},[e,t])}var iw="boq-session-id",nw="x-boq-session";function ow(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(iw);return e||(e=crypto.randomUUID(),window.localStorage.setItem(iw,e)),e}catch{return crypto.randomUUID()}}var $1="x-boq-client";function Xs(){return jt().client}function Cn(){let{client:e,apiKey:t}=jt();return pd()?t?{Authorization:`Bearer ${t}`}:{}:e?{[$1]:e}:{}}function bi(){return{...pd()?{}:{[nw]:ow()},...Cn()}}function Z1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Qa(e){return Z1(await e.json().catch(()=>({})))}var lw=9e4;async function sw(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),lw),i;try{i=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${lw/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let n=await Qa(i);if(!i.ok||n?.error){let o=n;throw new Error(o.detail??o.message??o.error??`Server error ${i.status}`)}return n}function cw(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),sw(za("/api/schedule"),{method:"POST",body:r,headers:bi()})}function uw(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return sw(za(`/api/schedule/${e}${a}`),{headers:Cn()})}function pw(e,t,a,r){let i=!1,n=null,o=performance.now();return{promise:new Promise((p,d)=>{let g=async()=>{if(!i)try{let m=await e();if(i)return;if(m.status==="completed"||m.status==="failed"){console.log(`[pollJob:${r??"job"}] ${m.status} (${Math.round(performance.now()-o)}ms)`),p(m);return}a?.(),n=setTimeout(g,t)}catch(m){i||d(m)}};n=setTimeout(g,t)}),cancel:()=>{i=!0,n&&(clearTimeout(n),n=null)}}}var St=Y(Ye());var dw=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var mw=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var fw=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var hw=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var gw=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var bw=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var ww=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var vw=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var yw=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var _w=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var xw=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var kw=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var Nw=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var Sw=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var Cw=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var qw=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var Ew=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var Mw=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Tw=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var zw=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Aw=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var Rw=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var Uw=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Dw=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Ow=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Bw=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var Lw=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var Hw=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var jw=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Qw=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var Gw=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var Yw=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Xw=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var ze=e=>typeof e=="string"?e:e.src,K1={"/decking/boards/diagonal.webp":ze(dw),"/decking/boards/no-border.webp":ze(mw),"/decking/boards/picture-frame.webp":ze(fw),"/decking/boards/straight.webp":ze(hw),"/fencing/gates/no-gate.webp":ze(gw),"/fencing/gates/single-gate.webp":ze(bw),"/fencing/gravel-board.webp":ze(ww),"/fencing/height/0.9.webp":ze(vw),"/fencing/height/1.2.webp":ze(yw),"/fencing/height/1.5.webp":ze(_w),"/fencing/height/1.8.webp":ze(xw),"/fencing/no-gravel-board.webp":ze(kw),"/quick-order/paste-list.webp":ze(Nw),"/quick-order/photo-list.webp":ze(Sw),"/quick-order/upload-file.webp":ze(Cw),"/schedule-products/building-sand.webp":ze(qw),"/schedule-products/drywall-screws.webp":ze(Ew),"/schedule-products/loft-insulation-roll.webp":ze(Mw),"/schedule-products/red-multi-stock-bricks.webp":ze(Tw),"/schedule-products/scrim-tape.webp":ze(zw),"/schedule-products/wall-ties.webp":ze(Aw),"/tool-images/architrave.webp":ze(Rw),"/tool-images/brick-block.webp":ze(Uw),"/tool-images/concrete-aggregate.webp":ze(Dw),"/tool-images/decking.webp":ze(Ow),"/tool-images/fencing.webp":ze(Bw),"/tool-images/insulation.webp":ze(Lw),"/tool-images/paint.webp":ze(Hw),"/tool-images/paving.webp":ze(jw),"/tool-images/plasterboard.webp":ze(Qw),"/tool-images/skirting.webp":ze(Gw),"/tool-images/timber.webp":ze(Yw),"/tool-images/truss.webp":ze(Xw)};function It(e){return K1[e]??e}var dd=Y(ee());function Qt(){return(0,dd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,dd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var md=Y(ee());function Jo(){return(0,md.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,md.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var qn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var Pw=(e,t)=>qn[t].some(a=>e.toLowerCase().endsWith(a)),En=e=>e.type.startsWith("image/")||Pw(e.name,"photo"),I1=e=>En(e)||Pw(e.name,"schedule"),Kw=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function fd(e,t=5242880){return I1(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${Kw(e.size)} - the limit is ${Kw(t)}.`:null:`Please upload a list or image file (${[...qn.schedule,...qn.photo].join(", ")}).`}var F1=e=>e.split(`
6971
- `).map(t=>t.trim()).filter(Boolean);function Jw(e){let t=F1(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function Iw(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let i=r.getContext("2d");if(!i)return e;i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),i.drawImage(t,0,0,r.width,r.height),t.close();let n=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!n||n.size>=e.size?e:new File([n],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y(Ye());var Zs=Y(Ye()),$s=Y(ee()),W1=[4,5,4],hd=4e3;function dr(){let[e,t]=(0,Zs.useState)(0);(0,Zs.useEffect)(()=>{let r=setInterval(()=>t(i=>i+1),hd);return()=>clearInterval(r)},[]);let a=0;return(0,$s.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:W1.map((r,i)=>(0,$s.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(n,o)=>(0,$s.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},i))},e)}var Io=Y(ee()),Ks=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function Fw(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function Ww(){let e=(0,$r.useRef)(Fw(Ks.map((o,l)=>l))),t=(0,$r.useRef)(0),[a,r]=(0,$r.useState)(Ks[e.current[0]]),[i,n]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{n(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=Fw(Ks.map((l,c)=>c)),t.current=0),r(Ks[e.current[t.current]]),n(!0)},600)},hd);return()=>clearInterval(o)},[]),(0,Io.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Io.jsx)(dr,{}),(0,Io.jsx)("p",{className:`banter-message${i?" is-visible":""}`,children:a})]})}var Ps=Y(Ye());function Fo(e,t){let a=(0,Ps.useRef)(t);a.current=t,(0,Ps.useEffect)(()=>{if(!e)return;let r=i=>{i.key!=="Escape"||i.defaultPrevented||i.isComposing||(i.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var I=Y(ee()),e_=[...qn.schedule,...qn.photo].join(","),t_={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]},Mn="#quote-entry",Js="metron-quick-quote-entry";function gd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a,draft:r,onSubmitDraft:i,onCancelMatch:n}){let[o,l]=(0,St.useState)(()=>r&&typeof window<"u"&&window.location.hash===Mn?r.tab:null),c=Sn(),[p,d]=(0,St.useState)(r?.text??""),[g,m]=(0,St.useState)(r?.file??null),[b,y]=(0,St.useState)(""),[T,D]=(0,St.useState)(!1),[f,u]=(0,St.useState)(!1),[w,v]=(0,St.useState)(null),S=(0,St.useRef)(0),R=(0,St.useRef)(0),z=(0,St.useRef)(null),A=p.split(`
6972
- `).filter(G=>G.trim()).length,Q=Jw(p),K=o==="paste"?!!p:!!g;(0,St.useEffect)(()=>{if(!g||!En(g)){v(null);return}let G=URL.createObjectURL(g);return v(G),()=>URL.revokeObjectURL(G)},[g]);let me=(0,St.useRef)(o??r?.tab??null);o&&(me.current=o),(0,St.useEffect)(()=>{if(r||window.location.hash!==Mn)return;let G=null;try{G=JSON.parse(window.sessionStorage.getItem(Js)??"null")}catch{}if(!G?.tab){let pe=new URL(window.location.href);pe.hash="",window.history.replaceState(window.history.state,"",pe);return}me.current=G.tab,l(G.tab),d(G.text??"")},[]),(0,St.useEffect)(()=>{if(o)try{window.sessionStorage.setItem(Js,JSON.stringify({tab:o,text:p}))}catch{}},[o,p]),(0,St.useEffect)(()=>{let G=()=>{if(window.location.hash===Mn)return l(me.current);l(null),R.current++,D(!1),n?.()};return window.addEventListener("popstate",G),()=>window.removeEventListener("popstate",G)},[]);let Ue=G=>{c("method_selected",{method:G}),l(G),a(null);let pe=window.location.hash;if(pe===Mn)return;let Te=new URL(window.location.href);Te.hash=Mn;let vt=pe==="#matched-products"||pe==="#quote-request";window.history[vt?"replaceState":"pushState"]({boqQuoteStage:"entry"},"",Te)},Be=()=>{l(null),a(null),window.location.hash===Mn&&window.history.back()};Fo(!!o&&!T,Be);let Ge=G=>{if(!G?.length)return;if(G.length>1)return y("Please choose one file at a time.");let pe=G[0],Te=fd(pe,En(pe)?1/0:void 0);if(Te)return y(Te);y(""),m(pe)},ke=async G=>{o==="paste"&&m(null),o==="upload"&&d(""),o&&i?.({tab:o,text:o==="paste"?p:"",file:o==="upload"?g:null});let pe=++R.current;D(!0);try{await G()}finally{pe===R.current&&D(!1)}},we=()=>{if(g)return c("list_submitted",{method:En(g)?"photo":"upload"}),ke(async()=>{if(!En(g))return t(g);try{let G=await Iw(g),pe=fd(G);if(pe)throw new Error(pe);await t(G)}catch(G){c("error",{stage:"photo"}),y(G?.message||"Failed to process image upload")}})},re=G=>G.dataTransfer.types.includes("Files"),ue=G=>{re(G)&&(G.preventDefault(),S.current+=1,u(!0))},ve=G=>{re(G)&&(S.current-=1,S.current<=0&&(S.current=0,u(!1)))},ut=G=>{re(G)&&(G.preventDefault(),S.current=0,u(!1),Ge(G.dataTransfer.files),Ue("upload"))};return(0,I.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:ue,onDragOver:G=>re(G)&&G.preventDefault(),onDragLeave:ve,onDrop:ut,children:[f&&(0,I.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,I.jsxs)("div",{className:"quick-order-card",children:[(0,I.jsxs)("div",{className:"quick-order-alt",children:[(0,I.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,I.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,I.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,I.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${o==="paste"?" entry-option-card--active":""}`,onClick:()=>Ue("paste"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/paste-list.webp"),alt:""})})]}),(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${o==="upload"?" entry-option-card--active":""}`,onClick:()=>Ue("upload"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/photo-list.webp"),alt:""})})]})]})]}),o&&(0,I.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!K&&Be(),children:(0,I.jsxs)("section",{className:`quick-order-workflow-modal${T?" quick-order-workflow-modal--matching":""}`,onClick:G=>G.stopPropagation(),children:[(0,I.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,I.jsx)("h2",{id:"quick-order-workflow-title",children:o==="paste"?"Type or paste a list":"Upload a file"}),(0,I.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:Be,"aria-label":"Close",children:(0,I.jsx)(Jo,{})})]}),(0,I.jsxs)("div",{className:"quick-order-panel",children:[(0,I.jsxs)("div",{className:"quick-order-body","aria-hidden":T,children:[(0,I.jsx)("div",{className:"quick-order-body-main",children:o==="paste"?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6970
+ `;var Be=Y(Ge());var Ys={};function cw(e){Ys={...e,client:e.client?.trim().toUpperCase()||void 0}}function jt(){return Ys}function hd(){return!!Ys.apiBaseUrl}var F1=e=>e.replace(/\/$/,"");function za(e){let t=Ys.apiBaseUrl;return t?`${F1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Nn=Y(Ge());var W1="metron:step",e_="metron_step",Jo=(0,Nn.createContext)(()=>{}),Sn=()=>(0,Nn.useContext)(Jo);function Xs(e,t){return(0,Nn.useCallback)((a,r={})=>{let i=jt(),n=i.analytics??"all";if(n==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(W1,{detail:o,bubbles:!0,composed:!0})),i.onEvent?.(o);let l=window.dataLayer;n==="all"&&Array.isArray(l)&&l.push({event:e_,...o})},[e,t])}var uw="boq-session-id",pw="x-boq-session";function dw(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(uw);return e||(e=crypto.randomUUID(),window.localStorage.setItem(uw,e)),e}catch{return crypto.randomUUID()}}var t_="x-boq-client";function Vs(){return jt().client}function Cn(){let{client:e,apiKey:t}=jt();return hd()?t?{Authorization:`Bearer ${t}`}:{}:e?{[t_]:e}:{}}function bi(){return{...hd()?{}:{[pw]:dw()},...Cn()}}function a_(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Qa(e){return a_(await e.json().catch(()=>({})))}var mw=9e4;async function fw(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),mw),i;try{i=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${mw/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let n=await Qa(i);if(!i.ok||n?.error){let o=n;throw new Error(o.detail??o.message??o.error??`Server error ${i.status}`)}return n}function hw(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),fw(za("/api/schedule"),{method:"POST",body:r,headers:bi()})}function gw(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return fw(za(`/api/schedule/${e}${a}`),{headers:Cn()})}function bw(e,t,a,r){let i=!1,n=null,o=performance.now();return{promise:new Promise((p,d)=>{let g=async()=>{if(!i)try{let m=await e();if(i)return;if(m.status==="completed"||m.status==="failed"){console.log(`[pollJob:${r??"job"}] ${m.status} (${Math.round(performance.now()-o)}ms)`),p(m);return}a?.(),n=setTimeout(g,t)}catch(m){i||d(m)}};n=setTimeout(g,t)}),cancel:()=>{i=!0,n&&(clearTimeout(n),n=null)}}}var Nt=Y(Ge());var ww=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var vw=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var yw=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var _w=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var xw=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var kw=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var Nw=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var Sw=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var Cw=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var qw=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var Ew=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var Mw=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var Tw=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var zw=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var Aw=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var Rw=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var Uw=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var Dw=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Ow=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var Bw=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Lw=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var Hw=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var jw=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Qw=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Gw=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var Yw=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var Xw=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var Vw=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var $w=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Zw=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var Kw=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var Pw=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Jw=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Te=e=>typeof e=="string"?e:e.src,r_={"/decking/boards/diagonal.webp":Te(ww),"/decking/boards/no-border.webp":Te(vw),"/decking/boards/picture-frame.webp":Te(yw),"/decking/boards/straight.webp":Te(_w),"/fencing/gates/no-gate.webp":Te(xw),"/fencing/gates/single-gate.webp":Te(kw),"/fencing/gravel-board.webp":Te(Nw),"/fencing/height/0.9.webp":Te(Sw),"/fencing/height/1.2.webp":Te(Cw),"/fencing/height/1.5.webp":Te(qw),"/fencing/height/1.8.webp":Te(Ew),"/fencing/no-gravel-board.webp":Te(Mw),"/quick-order/paste-list.webp":Te(Tw),"/quick-order/photo-list.webp":Te(zw),"/quick-order/upload-file.webp":Te(Aw),"/schedule-products/building-sand.webp":Te(Rw),"/schedule-products/drywall-screws.webp":Te(Uw),"/schedule-products/loft-insulation-roll.webp":Te(Dw),"/schedule-products/red-multi-stock-bricks.webp":Te(Ow),"/schedule-products/scrim-tape.webp":Te(Bw),"/schedule-products/wall-ties.webp":Te(Lw),"/tool-images/architrave.webp":Te(Hw),"/tool-images/brick-block.webp":Te(jw),"/tool-images/concrete-aggregate.webp":Te(Qw),"/tool-images/decking.webp":Te(Gw),"/tool-images/fencing.webp":Te(Yw),"/tool-images/insulation.webp":Te(Xw),"/tool-images/paint.webp":Te(Vw),"/tool-images/paving.webp":Te($w),"/tool-images/plasterboard.webp":Te(Zw),"/tool-images/skirting.webp":Te(Kw),"/tool-images/timber.webp":Te(Pw),"/tool-images/truss.webp":Te(Jw)};function It(e){return r_[e]??e}var gd=Y(ee());function Qt(){return(0,gd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,gd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var bd=Y(ee());function Io(){return(0,bd.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,bd.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var qn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var tv=(e,t)=>qn[t].some(a=>e.toLowerCase().endsWith(a)),En=e=>e.type.startsWith("image/")||tv(e.name,"photo"),o_=e=>En(e)||tv(e.name,"schedule"),ev=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function wd(e,t=5242880){return o_(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${ev(e.size)} - the limit is ${ev(t)}.`:null:`Please upload a list or image file (${[...qn.schedule,...qn.photo].join(", ")}).`}var l_=e=>e.split(`
6971
+ `).map(t=>t.trim()).filter(Boolean);function av(e){let t=l_(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function rv(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let i=r.getContext("2d");if(!i)return e;i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),i.drawImage(t,0,0,r.width,r.height),t.close();let n=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!n||n.size>=e.size?e:new File([n],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y(Ge());var Ks=Y(Ge()),Zs=Y(ee()),s_=[4,5,4],vd=4e3;function dr(){let[e,t]=(0,Ks.useState)(0);(0,Ks.useEffect)(()=>{let r=setInterval(()=>t(i=>i+1),vd);return()=>clearInterval(r)},[]);let a=0;return(0,Zs.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:s_.map((r,i)=>(0,Zs.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(n,o)=>(0,Zs.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},i))},e)}var Fo=Y(ee()),Ps=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function iv(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function nv(){let e=(0,$r.useRef)(iv(Ps.map((o,l)=>l))),t=(0,$r.useRef)(0),[a,r]=(0,$r.useState)(Ps[e.current[0]]),[i,n]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{n(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=iv(Ps.map((l,c)=>c)),t.current=0),r(Ps[e.current[t.current]]),n(!0)},600)},vd);return()=>clearInterval(o)},[]),(0,Fo.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Fo.jsx)(dr,{}),(0,Fo.jsx)("p",{className:`banter-message${i?" is-visible":""}`,children:a})]})}var Js=Y(Ge());function Wo(e,t){let a=(0,Js.useRef)(t);a.current=t,(0,Js.useEffect)(()=>{if(!e)return;let r=i=>{i.key!=="Escape"||i.defaultPrevented||i.isComposing||(i.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var yd={"#quote-entry":"entry","#matched-products":"results","#quote-request":"basket"},ov=!1,Fs="",_d=!1,lv=()=>window.navigation,Is=-1;function c_(){if(_d)return-1;let e=lv()?.currentEntry?.index;return e==null||Is<0||e===Is?0:e<Is?-1:1}function u_(e){let t=new URL(Fs||window.location.href),a=new URL(window.location.href);if(Fs=a.href,t.pathname!==a.pathname||t.search!==a.search||!(t.hash in yd)&&!(a.hash in yd))return;let r=t.href===a.href?c_():0;if(r){e.stopImmediatePropagation(),window.history.go(r);return}_d=!1;let i=e.state;Object.defineProperty(e,"state",{value:null}),setTimeout(()=>{if(window.location.href!==a.href)return;let n=yd[a.hash],o=n&&i?.turbo?{boqQuoteStage:n}:i;JSON.stringify(window.history.state)!==JSON.stringify(o)&&window.history.replaceState(o,"",a.href)})}function sv(){ov||typeof window>"u"||(ov=!0,Fs=window.location.href,window.addEventListener("popstate",u_,{capture:!0}),lv()?.addEventListener("currententrychange",e=>{Is=e.from?.index??-1}))}function Mn(e,t,a){window.history[e](t,"",a),Fs=window.location.href}function Ws(){_d=!0,window.history.back()}var I=Y(ee()),p_=[...qn.schedule,...qn.photo].join(","),d_={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]},Tn="#quote-entry",ec="metron-quick-quote-entry";function xd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a,draft:r,onSubmitDraft:i,onCancelMatch:n}){let[o,l]=(0,Nt.useState)(()=>r&&typeof window<"u"&&window.location.hash===Tn?r.tab:null),c=Sn(),[p,d]=(0,Nt.useState)(r?.text??""),[g,m]=(0,Nt.useState)(r?.file??null),[b,y]=(0,Nt.useState)(""),[T,D]=(0,Nt.useState)(!1),[f,u]=(0,Nt.useState)(!1),[w,v]=(0,Nt.useState)(null),S=(0,Nt.useRef)(0),R=(0,Nt.useRef)(0),z=(0,Nt.useRef)(null),A=p.split(`
6972
+ `).filter(G=>G.trim()).length,Q=av(p),K=o==="paste"?!!p:!!g;(0,Nt.useEffect)(()=>{if(!g||!En(g)){v(null);return}let G=URL.createObjectURL(g);return v(G),()=>URL.revokeObjectURL(G)},[g]);let me=(0,Nt.useRef)(o??r?.tab??null);o&&(me.current=o),(0,Nt.useEffect)(()=>{if(r||window.location.hash!==Tn)return;let G=null;try{G=JSON.parse(window.sessionStorage.getItem(ec)??"null")}catch{}if(!G?.tab){let pe=new URL(window.location.href);pe.hash="",Mn("replaceState",window.history.state,pe);return}me.current=G.tab,l(G.tab),d(G.text??"")},[]),(0,Nt.useEffect)(()=>{if(o)try{window.sessionStorage.setItem(ec,JSON.stringify({tab:o,text:p}))}catch{}},[o,p]),(0,Nt.useEffect)(()=>{let G=()=>{if(window.location.hash===Tn)return l(me.current);l(null),R.current++,D(!1),n?.()};return window.addEventListener("popstate",G),()=>window.removeEventListener("popstate",G)},[]);let Re=G=>{c("method_selected",{method:G}),l(G),a(null);let pe=window.location.hash;if(pe===Tn)return;let Me=new URL(window.location.href);Me.hash=Tn,Mn(pe==="#matched-products"||pe==="#quote-request"?"replaceState":"pushState",{boqQuoteStage:"entry"},Me)},Oe=()=>{l(null),a(null),window.location.hash===Tn&&Ws()};Wo(!!o&&!T,Oe);let Qe=G=>{if(!G?.length)return;if(G.length>1)return y("Please choose one file at a time.");let pe=G[0],Me=wd(pe,En(pe)?1/0:void 0);if(Me)return y(Me);y(""),m(pe)},ke=async G=>{o==="paste"&&m(null),o==="upload"&&d(""),o&&i?.({tab:o,text:o==="paste"?p:"",file:o==="upload"?g:null});let pe=++R.current;D(!0);try{await G()}finally{pe===R.current&&D(!1)}},we=()=>{if(g)return c("list_submitted",{method:En(g)?"photo":"upload"}),ke(async()=>{if(!En(g))return t(g);try{let G=await rv(g),pe=wd(G);if(pe)throw new Error(pe);await t(G)}catch(G){c("error",{stage:"photo"}),y(G?.message||"Failed to process image upload")}})},re=G=>G.dataTransfer.types.includes("Files"),ue=G=>{re(G)&&(G.preventDefault(),S.current+=1,u(!0))},ye=G=>{re(G)&&(S.current-=1,S.current<=0&&(S.current=0,u(!1)))},ut=G=>{re(G)&&(G.preventDefault(),S.current=0,u(!1),Qe(G.dataTransfer.files),Re("upload"))};return(0,I.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:ue,onDragOver:G=>re(G)&&G.preventDefault(),onDragLeave:ye,onDrop:ut,children:[f&&(0,I.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,I.jsxs)("div",{className:"quick-order-card",children:[(0,I.jsxs)("div",{className:"quick-order-alt",children:[(0,I.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,I.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,I.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,I.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${o==="paste"?" entry-option-card--active":""}`,onClick:()=>Re("paste"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/paste-list.webp"),alt:""})})]}),(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${o==="upload"?" entry-option-card--active":""}`,onClick:()=>Re("upload"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/photo-list.webp"),alt:""})})]})]})]}),o&&(0,I.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!K&&Oe(),children:(0,I.jsxs)("section",{className:`quick-order-workflow-modal${T?" quick-order-workflow-modal--matching":""}`,onClick:G=>G.stopPropagation(),children:[(0,I.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,I.jsx)("h2",{id:"quick-order-workflow-title",children:o==="paste"?"Type or paste a list":"Upload a file"}),(0,I.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:Oe,"aria-label":"Close",children:(0,I.jsx)(Io,{})})]}),(0,I.jsxs)("div",{className:"quick-order-panel",children:[(0,I.jsxs)("div",{className:"quick-order-body","aria-hidden":T,children:[(0,I.jsx)("div",{className:"quick-order-body-main",children:o==="paste"?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6973
6973
  insulated plasterboard 50mm
6974
- C24 timber 4.8m`,value:p,onChange:G=>d(G.target.value),"aria-label":"Paste schedule line items"}),Q&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",Q]}),(0,I.jsxs)("div",{className:"quick-order-hint",children:[(0,I.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!A||!!Q,onClick:()=>{c("list_submitted",{method:"paste",lines:A}),ke(()=>e(p))},"aria-label":"Match pasted lines",children:[(0,I.jsx)("span",{children:"Match line items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]}):(0,I.jsxs)(I.Fragment,{children:[b&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",b]}),(0,I.jsxs)("div",{className:`upload-zone${g?" has-file":""}`,onClick:()=>z.current?.click(),onDragOver:G=>G.preventDefault(),onDrop:ut,role:"button",tabIndex:0,onKeyDown:G=>(G.key==="Enter"||G.key===" ")&&z.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[w?(0,I.jsx)("img",{src:w,alt:g?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,I.jsx)("div",{className:"upload-zone-icon",children:(0,I.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,I.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,I.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,I.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),g?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-subtext",children:g.name}),(0,I.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:G=>{G.stopPropagation(),m(null),y(""),z.current&&(z.current.value="")},children:"Remove"})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,I.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,I.jsx)("input",{ref:z,type:"file",accept:e_,className:"visually-hidden",onChange:G=>Ge(G.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!g,onClick:()=>{we()},"aria-label":"Match uploaded items",children:[(0,I.jsx)("span",{children:"Match items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]})}),(0,I.jsx)("aside",{className:"quick-order-sidebar",children:t_[o].map((G,pe)=>(0,I.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,I.jsx)("span",{className:"quick-order-step-dot",children:pe+1}),(0,I.jsxs)("div",{children:[(0,I.jsx)("div",{className:"quick-order-step-title",children:G.title}),(0,I.jsx)("div",{className:"quick-order-step-desc",children:G.desc})]})]},G.title))})]}),T&&(0,I.jsx)("div",{className:"quick-order-matching-overlay",children:(0,I.jsx)(Ww,{})})]})]})})]})]})}var xe=Y(Ye());var bd=Y(ee());function Zr(){return(0,bd.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,bd.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var wi=Y(ee());function wd(){return(0,wi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,wi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,wi.jsx)("path",{d:"M21 3v5h-5"}),(0,wi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,wi.jsx)("path",{d:"M3 21v-5h5"})]})}var Wo=Y(ee());function vd({unit:e}){return(0,Wo.jsx)(Wo.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,Wo.jsx)("span",{className:"unit-sup",children:t},a):t)})}var ev=Y(ee());function a_(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function xa(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?a_(r,t):r}function ka(e,t){let a=xa(e,t);return a?(0,ev.jsx)(vd,{unit:a}):null}function el(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=xa(a[1]);return r?`per ${r}`:""}function vi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function ot(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function tv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var r_=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}],i_=[{match:["mortar"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Blue+Circle+Quality+Assured+Mortar+Mix+-+Photo.jpg"},{match:["mot type 1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/MOT+-+Photo+1.jpg"},{match:["soft sand","building sand"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Soft+Building+Sand+-+Photo+1.jpg"},{match:["cement"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/blue+circle+general+cement+bagged.jpg"},{match:["brick"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/class+B+engineering+brick+smooth+red+perforated+65mm+-+Photo+1+comp.jpg"},{match:["dense block","concrete block"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+solid+dense+concrete+block+-+Photo+1+-+1920+comp.jpg"},{match:["metal c stud","c stud"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/70mm+c+stud+angle.jpg"},{match:["timber","carcassing","sawn","c24","c16"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/47mm+x+100mm+sawn+treated+c16+-+Photo+1+1920.jpg"},{match:["osb"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/18mm+structural+OSB+-+Photo+1+comp.jpg"},{match:["dpc"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/225mm+damp+proof+course.jpg"},{match:["soil pipe","soil bend","underground","drainage"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/110mm+Soil+Pipe+Single+Socket+Black+3m+-+High+Res.jpg"},{match:["nail"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/galvanised+round+wire+nail+vertical.jpg"},{match:["retaining clip","retaining clips","insulation disc","insulation disks"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/multiple+zinc+insulation+discs.jpg"},{match:["wall tie"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Type+4+Wall+Ties+-+Photo.jpg"},{match:["loft insulation","loft roll","insulation roll"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/200mm+knauf+loft+roll+44+unwrapping.jpg"},{match:["pir insulation","insulation board","celotex","unilin","indiboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+celotex+sheet+logo.jpg"},{match:["plasterboard","wallboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/12.5mm+wallboard+tapered+edge+corner.jpg"},{match:["drywall screw"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/close+up+drywall+course+thread.jpg"},{match:["scrim","jointing tape","paper tape"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/50mm+scrim+tape.jpg"},{match:["adhesive","high grab","evostik","stixall","gripfill","sealant","ct1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Instant+Nails+Solvent+Free+Grab+Adhesive+White+290ml+-+Photo.jpg"}];function Ga(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),i=i_.find(o=>o.match.some(l=>r.includes(l)));if(i)return i.url;let n=r_.find(o=>o.match.some(l=>r.includes(l)));return n?It(n.path):r.includes("insulation")?tv(`
6974
+ C24 timber 4.8m`,value:p,onChange:G=>d(G.target.value),"aria-label":"Paste schedule line items"}),Q&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",Q]}),(0,I.jsxs)("div",{className:"quick-order-hint",children:[(0,I.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!A||!!Q,onClick:()=>{c("list_submitted",{method:"paste",lines:A}),ke(()=>e(p))},"aria-label":"Match pasted lines",children:[(0,I.jsx)("span",{children:"Match line items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]}):(0,I.jsxs)(I.Fragment,{children:[b&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",b]}),(0,I.jsxs)("div",{className:`upload-zone${g?" has-file":""}`,onClick:()=>z.current?.click(),onDragOver:G=>G.preventDefault(),onDrop:ut,role:"button",tabIndex:0,onKeyDown:G=>(G.key==="Enter"||G.key===" ")&&z.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[w?(0,I.jsx)("img",{src:w,alt:g?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,I.jsx)("div",{className:"upload-zone-icon",children:(0,I.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,I.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,I.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,I.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),g?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-subtext",children:g.name}),(0,I.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:G=>{G.stopPropagation(),m(null),y(""),z.current&&(z.current.value="")},children:"Remove"})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,I.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,I.jsx)("input",{ref:z,type:"file",accept:p_,className:"visually-hidden",onChange:G=>Qe(G.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!g,onClick:()=>{we()},"aria-label":"Match uploaded items",children:[(0,I.jsx)("span",{children:"Match items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]})}),(0,I.jsx)("aside",{className:"quick-order-sidebar",children:d_[o].map((G,pe)=>(0,I.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,I.jsx)("span",{className:"quick-order-step-dot",children:pe+1}),(0,I.jsxs)("div",{children:[(0,I.jsx)("div",{className:"quick-order-step-title",children:G.title}),(0,I.jsx)("div",{className:"quick-order-step-desc",children:G.desc})]})]},G.title))})]}),T&&(0,I.jsx)("div",{className:"quick-order-matching-overlay",children:(0,I.jsx)(nv,{})})]})]})})]})]})}var xe=Y(Ge());var kd=Y(ee());function Zr(){return(0,kd.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,kd.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var wi=Y(ee());function Nd(){return(0,wi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,wi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,wi.jsx)("path",{d:"M21 3v5h-5"}),(0,wi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,wi.jsx)("path",{d:"M3 21v-5h5"})]})}var el=Y(ee());function Sd({unit:e}){return(0,el.jsx)(el.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,el.jsx)("span",{className:"unit-sup",children:t},a):t)})}var cv=Y(ee());function m_(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function xa(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?m_(r,t):r}function ka(e,t){let a=xa(e,t);return a?(0,cv.jsx)(Sd,{unit:a}):null}function tl(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=xa(a[1]);return r?`per ${r}`:""}function vi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function ot(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function uv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var f_=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}],h_=[{match:["mortar"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Blue+Circle+Quality+Assured+Mortar+Mix+-+Photo.jpg"},{match:["mot type 1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/MOT+-+Photo+1.jpg"},{match:["soft sand","building sand"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Soft+Building+Sand+-+Photo+1.jpg"},{match:["cement"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/blue+circle+general+cement+bagged.jpg"},{match:["brick"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/class+B+engineering+brick+smooth+red+perforated+65mm+-+Photo+1+comp.jpg"},{match:["dense block","concrete block"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+solid+dense+concrete+block+-+Photo+1+-+1920+comp.jpg"},{match:["metal c stud","c stud"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/70mm+c+stud+angle.jpg"},{match:["timber","carcassing","sawn","c24","c16"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/47mm+x+100mm+sawn+treated+c16+-+Photo+1+1920.jpg"},{match:["osb"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/18mm+structural+OSB+-+Photo+1+comp.jpg"},{match:["dpc"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/225mm+damp+proof+course.jpg"},{match:["soil pipe","soil bend","underground","drainage"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/110mm+Soil+Pipe+Single+Socket+Black+3m+-+High+Res.jpg"},{match:["nail"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/galvanised+round+wire+nail+vertical.jpg"},{match:["retaining clip","retaining clips","insulation disc","insulation disks"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/multiple+zinc+insulation+discs.jpg"},{match:["wall tie"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Type+4+Wall+Ties+-+Photo.jpg"},{match:["loft insulation","loft roll","insulation roll"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/200mm+knauf+loft+roll+44+unwrapping.jpg"},{match:["pir insulation","insulation board","celotex","unilin","indiboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+celotex+sheet+logo.jpg"},{match:["plasterboard","wallboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/12.5mm+wallboard+tapered+edge+corner.jpg"},{match:["drywall screw"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/close+up+drywall+course+thread.jpg"},{match:["scrim","jointing tape","paper tape"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/50mm+scrim+tape.jpg"},{match:["adhesive","high grab","evostik","stixall","gripfill","sealant","ct1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Instant+Nails+Solvent+Free+Grab+Adhesive+White+290ml+-+Photo.jpg"}];function Ga(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),i=h_.find(o=>o.match.some(l=>r.includes(l)));if(i)return i.url;let n=f_.find(o=>o.match.some(l=>r.includes(l)));return n?It(n.path):r.includes("insulation")?uv(`
6975
6975
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
6976
6976
  <rect width="640" height="420" fill="#fbf1cf"/>
6977
6977
  <rect x="88" y="78" width="432" height="264" rx="16" fill="#f0c43f"/>
@@ -6982,7 +6982,7 @@ C24 timber 4.8m`,value:p,onChange:G=>d(G.target.value),"aria-label":"Paste sched
6982
6982
  <line x1="140" y1="240" x2="468" y2="240"/>
6983
6983
  </g>
6984
6984
  </svg>
6985
- `):tv(`
6985
+ `):uv(`
6986
6986
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
6987
6987
  <rect width="640" height="420" fill="#edf1f5"/>
6988
6988
  <rect x="132" y="108" width="376" height="204" rx="18" fill="#d5dde6"/>
@@ -6990,9 +6990,9 @@ C24 timber 4.8m`,value:p,onChange:G=>d(G.target.value),"aria-label":"Paste sched
6990
6990
  <rect x="168" y="188" width="250" height="24" rx="12" fill="#aab5c0"/>
6991
6991
  <rect x="168" y="232" width="220" height="24" rx="12" fill="#aab5c0"/>
6992
6992
  </svg>
6993
- `)}function Kr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var ov=e=>(e??"").trim().toLowerCase(),n_={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},yd=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),av=new Set(["box","bag","pack","pallet","roll","set","tub"]),rv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,iv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,yi=e=>{let t=ov(e);return n_[t]??t},lt=(e,t)=>{let a=yi(e),r=yi(t);return a.length>0&&a===r},o_=(e,t)=>{let a=ov(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},l_=e=>(e??"").split(",").map(t=>yi(t)).filter(Boolean),s_=(e,t)=>{let a=l_(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||lt(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||lt(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||lt(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},nv=(e,t)=>lt(t,"pallet")?e.itemsPerPallet??null:lt(t,"pack")?e.itemsPerPack??null:lt(t,"box")?e.itemsPerBox??null:null,c_=(e,t,a)=>{if(!lt(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!lt(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function Is(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,i)=>r+(i??0),0)}function Ft(e,t){let a=e.qty,r=yi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=yi(e.unit)||(a>0&&yd.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?yd.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=v=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${r}.`:v,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return p("Quantity needs confirmation.");if(!s_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let d=null,g="review",m=e.roundingRule,b=`Quantity review required, initial request needed ${a} ${i}.`,y=1+o,T=c_(e,i,r),D=e.unitConversions?.find(v=>lt(v.requestUom,i));if(!!e.saleUnit&&(lt(i,r)||!!D||lt(i,"each")&&!av.has(r)))if(lt(i,r))d=a*y/n,g="direct",b=`${a} ${i}${o>0?` x ${y}`:""}`;else if(D){d=a*y/D.quantityPerSaleUnit,g="derived";let v=1/D.quantityPerSaleUnit,S=Math.round(v);b=lt(r,"each")&&D.quantityPerSaleUnit<1&&Math.abs(v-S)<1e-9?`${a} ${i}${o>0?` x ${y}`:""} x ${S} per ${i}`:`${a} ${i}${o>0?` x ${y}`:""} / ${D.quantityPerSaleUnit} ${i} per ${r}`}else lt(i,"each")&&!av.has(r)&&(d=a*y/n,g="derived",b=`${a} ${r}${o>0?` x ${y}`:""}`);else if(lt(i,r)&&n>0)d=a*y/n,g="direct",b=o>0?`${a} ${i} x ${y} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(lt(i,"each")&&n>0&&yd.has(r))d=a*y/n,g="derived",b=o>0?`${a} each x ${y} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(nv(e,i)!=null&&n>0){let v=nv(e,i)??0;d=a*v*y/n,g="derived";let S=`${a} ${i} x ${v} each${o>0?` x ${y}`:""}`;b=n===1&&lt(r,"each")?S:`${S} / ${n} each per ${r}`}else if(T!=null)d=a*y/T,g="derived",m??(m="round_up_each"),b=`${a} m2 x ${y} / ${T} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(d=a*y/n,g="derived",b=`${a} ${i}${o>0?` x ${y}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;lt(i,"m2")&&v!=null&&v>0&&(d=a*y/v,g="derived",b=`${a} m2 x ${y} / ${v} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;lt(i,"m2")&&v!=null&&v>0?(d=a/v,g="derived",b=`${a} m2 / ${v} m2 per sell unit`):lt(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(d=a*e.itemsPerM2*y/n,g="derived",b=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${y} / ${n}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;lt(i,"m")&&v!=null&&v>0&&(d=a*y/v,g="derived",b=`${a} m x ${y} / ${v} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let v=rv(a,i),S=rv(e.coverageQty??0,yi(e.coverageUom));v!=null&&S!=null&&S>0&&(d=v*y/S,g="derived",b=`${a} ${i} x ${y} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"){let v=iv(a,i),S=iv(e.coverageQty??0,yi(e.coverageUom));v!=null&&S!=null&&S>0&&(d=v*y/S,g="derived",b=`${a} ${i} x ${y} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;lt(i,"m3")&&v!=null&&v>0&&(d=a/v,g="derived",b=`${a} m3 / ${v} m3 per ${r}`)}}if(d==null||!Number.isFinite(d)||d<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let u=o_(d,m),w=l?c:u;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:u,requiredSellUnits:w,unitPrice:e.price,lineTotal:e.price!=null&&w!=null?e.price*w:null,calculation:l?`${b} = ${u} ${r} (manually set to ${w})`:`${b} = ${w} ${r}`,costingMode:g}}var lv=()=>import("./xlsx-K4MOA2QM.js"),al=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],u_=al.indexOf("Line total");function p_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function sv(e){let t=await lv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[al],n=0;for(let c of e){let{item:p,best:d,qty:g,band:m,unmatchable:b,decision:y}=c,T=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),D=!b&&d?.price!=null?d.price*g:null;D!=null&&(n+=D),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",T,g,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),y?.technical_classification??"",y?.include_in_quote==null?"":y.include_in_quote?"yes":"no",y?.approval_required==null?"":y.approval_required?"yes":"no",y?.approval_type??"",y?.missing_information.join(", ")??"",y?.confidence??"",y?.reason??"",b?"-":d?.product_id??y?.selected_candidate_id??"-",b?"-":d?.description??"-",b?"-":d?.price_basis??"-",b?null:d?.price??null,D,b?"-":m,p_(c)])}i.push(Array(al.length).fill(null));let o=Array(al.length).fill(null);o[0]="Estimated total",o[u_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(al.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var tl=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function cv(e,t){let a=await lv(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],tl]:[tl],o=0;for(let p of e){let d=Ft(p),g=d.lineTotal;g!=null&&(o+=g),n.push([p.productId,p.description,d.costingMode,d.requestedAmount,xa(d.requestedUnit),d.salesUnitSize,xa(d.sellUnit),d.requiredSellUnits,d.unitPrice,g])}n.push(Array(tl.length).fill(null));let l=Array(tl.length).fill(null);l[0]="Estimated total",l[tl.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var s=Y(ee()),xd="__none__",rl=24,d_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function mv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var m_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function f_(e,t){if(t!==xd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function uv(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function h_(e){return e?e.replace(/_/g," "):"not stated"}function g_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function zn(e,t){if(e==null)return"-";let a=el(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function kd(e){return e&&e.length>0?e.join(" x "):"-"}function b_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Tn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Pr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function w_(e,t){return t>0||e==null?null:ot(e)}var pv=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function v_(e){let t=new Map;return[...new Set(e.filter(mr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:pv[i%pv.length]})}),t}function mr(e){return!1}function An(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function _d({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function y_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,6),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let i=new Map(e.map(o=>[o.product_id,o])),n=r.map(o=>i.get(o)).filter(o=>o!=null);if(a&&!n.some(o=>o.product_id===a)){let o=i.get(a);o&&n.unshift(o)}return[...new Map(n.map(o=>[o.product_id,o])).values()].slice(0,6)}function Fs(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function Ws(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function __({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Ws(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Ws(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Ws(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Ws(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function x_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:kd(r.measurements_mm)}),(0,s.jsx)("td",{children:el(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function dv({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Tn(e.procurement_aliases)],["Retrieval queries",Tn(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",kd(e.attrs.measurements_mm)],["Stock length",b_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",Tn(e.installation_clues)],["System clues",Tn(e.system_clues)],["Component requirements",Tn(e.component_requirements)],["Linked group",An(e)||"-"],["Flags",Tn(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function k_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function N_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function S_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:i=!1,linkedGroupMeta:n}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"No automatic match:":`AI review (${t.confidence??"confidence not stated"}):`;return i?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",An(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(dv,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(dv,{item:e,result:a}),r&&(0,s.jsx)(k_,{item:e}),r&&(0,s.jsx)(N_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",An(e)]}):null]}),r&&(0,s.jsx)(x_,{queries:a?.retrieval_debug??[]})]})}function C_({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:d=!1,debugEnabled:g=!1,forceReviewNote:m=!1,linkedGroupMeta:b}){let y=d||o==="detailed",T=g&&o==="detailed",D=y||m?(0,s.jsx)(S_,{item:e,decision:r,result:a,showRetrievalDebug:T,reviewOnly:m&&!y,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||d||o==="detailed"?t:y_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),T&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,w)=>{let v=u.product_id===n;return(0,s.jsxs)("tr",{className:v?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:kd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:zn(u.price,u.price_basis)}),T&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(g_,{band:mv(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${w}`)})})]})]})}function Nd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:d=!1}){let g=!d&&Xs()==="QZA6-MRA4",m=g?"quote":"basket",{results:b,lineItems:y,parseReport:T,timings:D}=e,[f,u]=(0,xe.useState)({}),w=Sn(),[v,S]=(0,xe.useState)({}),[R,z]=(0,xe.useState)({}),[A,Q]=(0,xe.useState)(""),[K,me]=(0,xe.useState)(null),[Ue,Be]=(0,xe.useState)(1),Ge=jt().debug===!0,[ke,we]=(0,xe.useState)("simple"),[re,ue]=(0,xe.useState)(d?"list":"tile"),[ve,ut]=(0,xe.useState)(!1),[G,pe]=(0,xe.useState)(null),[Te,vt]=(0,xe.useState)(""),[Ot,Ut]=(0,xe.useState)([]),[Ze,Ne]=(0,xe.useState)(!1),[ye,Ee]=(0,xe.useState)(null),[M,O]=(0,xe.useState)(!1),[ie,se]=(0,xe.useState)(null),he=(0,xe.useRef)(null),[Ae,Ke]=(0,xe.useState)(new Set),[h,E]=(0,xe.useState)(new Set),[N,X]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{Be(1)},[A,K,re]);let Z=new Map(b.map(x=>[x.line_id,x])),k=v_(y),L=y.map(x=>{let H=Z.get(x.line_id),ge=H?.decision,pt=m_(x),Pe=f[x.line_id],ea=f_(H,Pe),Ti=a[x.line_id],Pv=Pe===xd?void 0:v[x.line_id]??(Ti&&Ti.productId!==ea?.product_id?uv(Ti):ea),um=pt?void 0:Pv,Jv=x.qty??0;return{item:x,result:H,decision:ge,unmatchable:pt,best:um,qty:Jv,band:mv(um?.scores?.overall)}}),ce=L.some(x=>!x.unmatchable&&!x.best&&!h.has(x.item.line_id))?null:Is(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),_e=0;for(let x of L){if(x.unmatchable||x.decision?.include_in_quote!==!0||!x.best)continue;let H=a[x.item.line_id];(!H||Ft(H).lineTotal==null)&&(_e+=1)}_e>0&&(ce=null);let yt=w_(ce,_e),rt=x=>!x.unmatchable&&!x.best&&x.decision?.technical_classification!=="no_suitable_candidate"&&Fs(x.result).length>0,Ct=x=>x.best??Fs(x.result)[0],Jr=L.filter(x=>!x.unmatchable&&!x.best).filter(x=>!h.has(x.item.line_id)),yc=L.filter(x=>h.has(x.item.line_id)),Yt=L;if(A.trim()){let x=A.trim().toLowerCase();Yt=Yt.filter(H=>H.item.description_original?.toLowerCase().includes(x)||Ct(H)?.description?.toLowerCase().includes(x))}if(K){let x=K==="asc"?1:-1;Yt=[...Yt].sort((H,ge)=>x*(H.item.description_original||"").localeCompare(ge.item.description_original||""))}let br=Math.max(1,Math.ceil(Yt.length/rl)),_t=Math.min(Ue,br),Ci=Yt.slice((_t-1)*rl,_t*rl),am=Ci.filter(x=>!x.unmatchable&&x.best),gx=Ci.filter(x=>rt(x)),_c=Ci.filter(x=>!x.unmatchable&&(x.best||rt(x))),rm=Ci.filter(x=>x.unmatchable||!x.best&&!rt(x)),J=G?L.find(x=>x.item.line_id===G)??null:null,Gv=!d&&!c&&!J&&Jr.length>0,Yn=(0,xe.useRef)(null),Xn=()=>{let x=he.current;if(!x)return;let{top:H,left:ge,width:pt,height:Pe}=x.getBoundingClientRect(),Ti=x.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;se({top:H,left:ge,width:Ti?Ti-ge:pt,height:Pe})};(0,xe.useEffect)(()=>(window.addEventListener("scroll",Xn,!0),window.addEventListener("resize",Xn),()=>{window.removeEventListener("scroll",Xn,!0),window.removeEventListener("resize",Xn)})),(0,xe.useEffect)(()=>{let x=H=>{Yn.current&&!H.composedPath().includes(Yn.current)&&Yn.current.removeAttribute("open")};return document.addEventListener("click",x),()=>document.removeEventListener("click",x)},[]);let qi=x=>{pe(x),vt("")},Yv=()=>{if(!G)return;let x=a[G];if(x){u(H=>({...H,[G]:x.productId})),S(H=>({...H,[G]:uv(x)}));return}u(H=>{let ge={...H};return delete ge[G],ge}),S(H=>{let ge={...H};return delete ge[G],ge})},Va=(x=!1)=>{let H=G?a[G]:void 0;!x&&H&&J?.best&&H.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(x||Yv(),pe(null),X(!1))};Fo(M,()=>O(!1)),Fo(!!J&&!M,()=>Va());let Xv=x=>{if(Ke(H=>new Set(H).add(x)),Jr.some(H=>H.item.line_id!==x)){Va(!0);return}p(),Va(!0)},Vv=x=>{if(xc(x),E(H=>new Set(H).add(x)),Jr.some(H=>H.item.line_id!==x)){Va(!0);return}p(),Va(!0)},$v=()=>{E(x=>new Set([...x,...Jr.map(H=>H.item.line_id)])),p()},im=()=>{J?.best&&(om(J.item.line_id,J.best),r(Ei(J)),N?Xv(J.item.line_id):Va(!0))},nm=rm.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:rm.map(x=>{let{item:H,qty:ge}=x;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>qi(H.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Pr(H,y)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},H.line_id)})})]}):null,xc=x=>{u(H=>({...H,[x]:xd})),S(H=>({...H,[x]:void 0})),z(H=>({...H,[x]:void 0})),i(x)},kc=(x,H)=>{u(ge=>({...ge,[x]:H.product_id})),S(ge=>({...ge,[x]:H}))},om=(x,H)=>{H.method==="catalogue_search"&&z(ge=>({...ge,[x]:H}))};function bx(){w("downloaded",{type:"schedule",lines:L.length}),sv(L.map(({item:x,best:H,qty:ge,band:pt,unmatchable:Pe,decision:ea})=>({item:x,best:H,qty:ge,band:pt,unmatchable:Pe,decision:ea})))}function Ei(x){let H=x.best??Fs(x.result)[0];return Kr(H,{lineId:x.item.line_id,description:x.item.description_original,unit:x.item.unit,qty:x.qty,linkedContext:x.item.linked_group_role==="dependent"&&x.item.linked_group_id?y.filter(ge=>ge.linked_group_id===x.item.linked_group_id&&ge.linked_group_role==="anchor").slice(0,1).map(ge=>{let pt=a[ge.line_id];return{line_id:ge.line_id,product_id:pt?.productId??null,measurements_mm:pt?.measurementsMm??ge.attrs.measurements_mm,description:pt?.description??ge.description_original,qty:ge.qty,unit:ge.unit,role:"anchor"}}):void 0})}(0,xe.useEffect)(()=>{if(!o){for(let x of L)!x.unmatchable&&x.best&&r(Ei(x));l()}},[o]),(0,xe.useEffect)(()=>{for(let x of L)!a[x.item.line_id]&&!x.unmatchable&&x.best&&r(Ei(x))},[e]),(0,xe.useEffect)(()=>{if(!G){Ut([]),Ee(null),Ne(!1);return}let x=Te.trim();if(!x){Ut([]),Ee(null),Ne(!1);return}let H=!1,ge=window.setTimeout(async()=>{try{Ne(!0),Ee(null);let pt=await fetch(za(`/api/catalogue/search?q=${encodeURIComponent(x)}`),{headers:bi()}),Pe=await Qa(pt);if(!pt.ok)throw new Error(Pe?.error||Pe?.message||"Failed to search catalogue");H||Ut(Array.isArray(Pe?.items)?Pe.items:[])}catch(pt){H||(Ut([]),Ee(pt?.message||"Failed to search catalogue"))}finally{H||Ne(!1)}},250);return()=>{H=!0,window.clearTimeout(ge)}},[Te,G]);let Nc=Object.keys(a).length,qa=Te.trim(),Sc=Fs(J?.result),ul=J?.decision?.technical_classification==="no_suitable_candidate"||!!J&&!J.best,lm=J?.decision?.technical_classification!=null,sm=J?.decision?.reason??(ul?"No catalogue candidate found. Refine the request or search the catalogue.":null),Zv=Ot.map(x=>({product_id:x.product_id,description:x.description,source_list:x.source_list,price:x.price,price_basis:x.price_basis,uoi_count:x.uoi_count??null,uoi:x.uoi,pdp_photo_url:x.pdp_photo_url??null,conversion:x.conversion,measurements_mm:x.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Vn=qa?Zv:Sc,Mi=J?R[J.item.line_id]:void 0,$n=!qa&&Mi&&!Vn.some(x=>x.product_id===Mi.product_id)?[...Vn,Mi]:Vn,cm=(()=>{let x=$n.slice(0,qa?12:6);return qa||!Mi||x.some(H=>H.product_id===Mi.product_id)?x:[...x,Mi]})(),pl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,Kv=!!J?.best&&!!a[J.item.line_id]&&!pl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${d?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${d?"":" quick-order-hero--customer"}`,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:yt??"Review quantities"})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",g?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,disabled:Nc===0,"aria-label":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:g?"View Quote":"View Basket"}),yt!=null&&(0,s.jsx)("strong",{children:yt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ge&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ve,onClick:()=>ut(x=>!x),children:ve?"Hide timings":"Show timings"})}),Ge&&ve&&(0,s.jsx)(__,{...D}),!g&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[_e>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:_e})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:A,onChange:x=>Q(x.target.value),"aria-label":"Search line items"}),!d&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${re==="tile"?" is-active":""}`,"aria-pressed":re==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ue("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${re==="list"?" is-active":""}`,"aria-pressed":re==="list","aria-label":"List view",title:"List view",onClick:()=>ue("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Ge&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(x=>x==="simple"?"detailed":"simple"),children:ke==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Yn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:d_.map(x=>{let H=K===x.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${H?" is-active":""}`,onClick:()=>{me(H?null:x.dir),Yn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:H?"\u2713":""}),x.label]},x.dir)})})]})]})]})}),re==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Va(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:x=>x.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Va(),"aria-label":"Close product options",children:(0,s.jsx)(Jo,{})}),(0,s.jsx)("div",{className:"results-review-page",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Va(),children:[(0,s.jsx)(Zr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ge&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(x=>x==="simple"?"detailed":"simple"),children:ke==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:Te,onChange:x=>vt(x.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>xc(J.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(Ct(J)?.description||J.item.description_original,Ct(J)?.product_id,Ct(J)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Pr(J.item,y)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[vi(J.qty)," ",ka(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:zn(J.best.price,J.best.price_basis)}):null]}):Ct(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ct(J)?.description}),Ct(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:zn(Ct(J)?.price??null,Ct(J)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),mr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(_d,{meta:k.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:An(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?i(J.item.line_id):(J.best&&om(J.item.line_id,J.best),r(Ei(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[J.item.line_id]?"\u2713 Added":d?"+ Add to selection":`Add to ${m}`})})]})]}),Ze?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!Ze&&ye?(0,s.jsx)("div",{className:"results-empty-card",children:ye}):null,!Ze&&!ye&&qa&&Vn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!Ze&&!ye?(0,s.jsx)(C_,{item:J.item,candidates:Vn,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:ke,linkedGroupMeta:mr(J.item)?k.get(J.item.linked_group_id):void 0,onPick:x=>kc(J.item.line_id,x),onClear:()=>xc(J.item.line_id),showAll:d||Ge||qa.length>0,internal:d,debugEnabled:Ge,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Pr(J.item,y)||"Original request"})]}),sm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:ul?"No automatic match:":"AI review:"})," ",sm]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:ul?Sc.length>0?"Choose a product":"No suitable product found":lm?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:ul?Sc.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":lm?`Select the option you want to add to your ${m}.`:"Search the catalogue to choose a product."})]})}),!qa&&$n.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:cm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>kc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${zn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null,$n.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:Te,onChange:x=>vt(x.target.value),"aria-label":"Search catalogue"})]}),qa&&Ze?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,qa&&!Ze&&ye?(0,s.jsx)("div",{className:"results-empty-card",children:ye}):null,qa&&!Ze&&!ye&&$n.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,qa&&!Ze&&!ye&&$n.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:cm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>kc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${zn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null]}),J.best?Kv?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{im()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${m}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${pl?" cta-btn-secondary":""}`,onClick:()=>{pl?i(J.item.line_id):im()},children:(0,s.jsx)("span",{children:pl?`Remove from ${m}`:`Add selected product to ${m}`})}):null,N?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>Vv(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,_c.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:_c.map(x=>{let{item:H,best:ge,qty:pt}=x,Pe=Ct(x),ea=!ge&&rt(x);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>qi(H.line_id),"aria-label":`Review match for ${Pr(H,y)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[ea||mr(H)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[mr(H)?(0,s.jsx)(_d,{meta:k.get(H.linked_group_id)}):(0,s.jsx)("span",{}),ea?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(Pe?.description||H.description_original,Pe?.product_id,Pe?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Pe?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Pe.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Pe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:ea?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Pr(H,y)}),mr(H)?(0,s.jsx)("div",{className:"results-row-meta",children:An(H)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[d&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qi(H.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[H.line_id]?i(H.line_id):r(Ei(x))},disabled:!Pe,"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})]})]},H.line_id)})})}):null,nm]})]}):(0,s.jsxs)(s.Fragment,{children:[ie&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ie,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),ke==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),ke==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:d?"Selection":g?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:ke==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),_c.map(x=>{let{item:H,result:ge,decision:pt,best:Pe}=x;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>qi(H.line_id),onMouseEnter:ea=>{he.current=ea.currentTarget,Xn()},onMouseLeave:()=>{he.current=null,se(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Pr(H,y)}),mr(H)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(_d,{meta:k.get(H.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:An(H)})]}):null]}),(0,s.jsx)("td",{children:Pe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Pe.description,children:Pe.description}),ke==="detailed"&&pt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[h_(pt.technical_classification),pt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Pe?.price!=null?zn(Pe.price,Pe.price_basis):"-"}),ke==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:ea=>{ea.stopPropagation(),a[H.line_id]?i(H.line_id):r(Ei(x))},"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})})]},H.line_id)})]})]})}),nm]}),!J&&br>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(_t-1)*rl+1,"\u2013",Math.min(_t*rl,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Be(_t-1),disabled:_t===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",_t," of ",br]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Be(_t+1),disabled:_t===br,children:"Next"})]})]}),(T.itemCount!=null||T.headingCount!=null||T.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[T.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.itemCount})," items parsed"]}),T.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.headingCount})," headings"]}),T.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>O(!0),"aria-label":"Start over",children:[(0,s.jsx)(wd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,disabled:Nc===0,"aria-label":d?"View selection":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[d?"View Selection":g?"View Quote":"View Basket"," (",Nc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),Gv&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:Jr.map(x=>{let H=Ae.has(x.item.line_id),ge=rt(x);return(0,s.jsx)("div",{className:`review-gate-item${H?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{X(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Pr(x.item,y)}),(0,s.jsx)("span",{children:x.decision?.reason||(ge?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:H?"Choice made":"Choose a product"})]})},x.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:$v,children:"Skip all"}),yc.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),yc.map(x=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{E(H=>{let ge=new Set(H);return ge.delete(x.item.line_id),ge}),X(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Pr(x.item,y)}),(0,s.jsx)("span",{children:`Not added to your ${m}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},x.item.line_id))]}):null]})}),M&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",g?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>O(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{O(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var gt=Y(Ye());var At=Y(Ye()),fv=Y(ee());function Rn(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function q_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var Sd=(0,At.createContext)(null);function ec({children:e,onOpenBasket:t}){let[a,r]=(0,At.useState)({}),i=(0,At.useCallback)(m=>{r(b=>q_(b,m))},[]),n=(0,At.useCallback)(m=>{r(b=>{let y={...b};for(let T of m)y[T.lineId]=T;return y})},[]),o=(0,At.useCallback)(m=>{r(b=>{let y={...b};return delete y[m],y})},[]),l=(0,At.useCallback)((m,b)=>{r(y=>y[m]?{...y,[m]:{...y[m],qty:b,sellUnitsOverride:null}}:y)},[]),c=(0,At.useCallback)((m,b)=>{r(y=>y[m]?{...y,[m]:{...y[m],sellUnitsOverride:b}}:y)},[]),p=(0,At.useCallback)(m=>{r(b=>{let y=!1,T={...b};for(let[D,f]of Object.entries(m))T[D]&&(T[D]={...T[D],...f},y=!0);return y?T:b})},[]),d=(0,At.useCallback)(()=>r({}),[]),g=(0,At.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:d,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,d,t]);return(0,fv.jsx)(Sd.Provider,{value:g,children:e})}function Un(){let e=(0,At.useContext)(Sd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function tc(){return(0,At.useContext)(Sd)}var q=Y(ee()),hv=.2,il=10,gv="Enter a valid email address so we can send your quote.",E_=(e,t)=>{let a=`${t.requestedAmount} ${xa(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${xa(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${xa(t.sellUnit,2)} per ${xa(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},M_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${xa(e.sellUnit,1)}.`;function T_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function nl(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ol({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,gt.useId)(),d=!c&&Xs()==="QZA6-MRA4",g=Object.values(e),[m,b]=(0,gt.useState)(""),[y,T]=(0,gt.useState)(!1),[D,f]=(0,gt.useState)(!1),u=Sn(),[w,v]=(0,gt.useState)(""),[S,R]=(0,gt.useState)({}),[z,A]=(0,gt.useState)({}),[Q,K]=(0,gt.useState)(1),[me,Ue]=(0,gt.useState)({}),[Be,Ge]=(0,gt.useState)(!1),[ke,we]=(0,gt.useState)("0"),[re,ue]=(0,gt.useState)({}),ve=(0,gt.useRef)(new Map);(0,gt.useEffect)(()=>{if(!r)return;for(let N of Object.values(e))Ft(N).requiredSellUnits!=null&&ve.current.delete(N.lineId);let h=Object.values(e).filter(N=>{if(N.productId==="-"||Ft(N).requiredSellUnits!=null)return!1;let X=Rn(N);return ve.current.get(N.lineId)===X?!1:(ve.current.set(N.lineId,X),!0)});if(h.length===0)return;let E=new Map(h.map(N=>[N.lineId,Rn(N)]));ue(N=>({...N,...Object.fromEntries(E)})),fetch(za("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Cn()},body:JSON.stringify({lines:h.map(N=>({line_id:N.lineId,product_id:N.productId,requested_description:N.requestedDescription??N.description,requested_qty:N.qty,requested_uom:N.unit||null,linked_context:N.linkedContext??[],selected_description:N.description,selected_uoi:N.uoi,selected_uoi_count:N.uoiCount,selected_conversion:{sales_uom_normalised:N.salesUomNormalised,conversion_type:N.conversionType,sales_unit_size:N.salesUnitSize,sales_unit_size_uom:N.salesUnitSizeUom,coverage_qty:N.coverageQty,coverage_uom:N.coverageUom}}))})}).then(N=>N.ok?Qa(N):null).then(N=>{let X={},Z=new Map(h.map(k=>[k.lineId,Rn(k)]));for(let k of N?.data?.items??N?.items??[]){let L=k?.conversion;if(!L||typeof k?.line_id!="string"||ve.current.get(k.line_id)!==Z.get(k.line_id))continue;let P=e[k.line_id];X[k.line_id]={conversionType:L.conversion_type,requestUomsSupported:L.request_uoms_supported,salesUomNormalised:L.sales_uom_normalised,salesUnitSize:L.sales_unit_size,salesUnitSizeUom:L.sales_unit_size_uom,coverageQty:L.coverage_qty,coverageUom:L.coverage_uom,roundingRule:L.rounding_rule,conversionConfidence:L.conversion_confidence,conversionNotes:L.conversion_notes,...P?.qty===0&&Number.isFinite(L.suggested_order_qty)&&L.suggested_order_qty>0?{qty:L.suggested_order_qty,unit:L.suggested_order_uom||P.unit}:{}}}Object.keys(X).length>0&&r(X)}).catch(N=>console.error("Catalogue conversion resolution failed",N)).finally(()=>{ue(N=>{let X={...N};for(let[Z,k]of E)X[Z]===k&&delete X[Z];return X})})},[e,r]);function ut(h){R(E=>{let N={...E};return delete N[h],N})}function G(h,E){let N=parseFloat(E);!isNaN(N)&&N>=0&&t(h,Math.min(N,1e5)),ut(h)}function pe(h,E,N){t(h,Math.min(1e5,Math.max(0,E+N))),ut(h)}function Te(h){A(E=>{let N={...E};return delete N[h],N})}function vt(h,E){let N=parseFloat(E);!isNaN(N)&&N>=0&&a(h,Math.min(N,1e5)),Te(h)}function Ot(h,E,N){a(h,Math.min(1e5,Math.max(0,E+N))),Te(h)}async function Ut(){if(Ze.some(({pricing:E})=>E.lineTotal==null)){v("Confirm the highlighted quantities before requesting a quote.");return}let h=m.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h)){v(gv);return}v(""),f(!0);try{let E=await fetch(za("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Cn()},body:JSON.stringify({email:h,items:Ze.map(({item:N,pricing:X})=>{let Z=X.requiredSellUnits??X.requestedAmount,k=X.requiredSellUnits!=null?X.sellUnit:X.requestedUnit;return{product_id:N.productId,description:N.description,quantity:Z,unit:xa(k,Z),unit_price:X.requiredSellUnits!=null?X.unitPrice:null,line_total:X.lineTotal}})})});if(!E.ok){let N=await Qa(E);console.error("Quote request failed",E.status,N?.message),v(E.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}Ee!=null&&u("quote_requested",{items:Ze.length,total:Math.round(Ee*100)/100}),T(!0),l?.(),window.scrollTo(0,0)}catch{v("Your request couldn't be sent. Check your connection and try again.")}finally{f(!1)}}let Ze=g.map(h=>({item:h,pricing:Ft(h,{wasteFactorEnabled:Be,wasteFactorOverride:Math.max(0,Number.parseFloat(ke)||0)/100})})),Ne=Is(g,{wasteFactorEnabled:Be,wasteFactorOverride:Math.max(0,Number.parseFloat(ke)||0)/100}),ye=Ne==null?null:Ne*hv,Ee=Ne==null?null:Ne*(1+hv),M=Ze.filter(({pricing:h})=>h.lineTotal==null).length,O=Object.keys(re).length,ie=!!r&&g.some(h=>{if(h.productId==="-"||Ft(h).requiredSellUnits!=null)return!1;let E=Rn(h);return ve.current.get(h.lineId)!==E||re[h.lineId]===E}),se=(0,gt.useRef)({items:Ze.length,...Ee==null?{}:{total:Math.round(Ee*100)/100}});(0,gt.useEffect)(()=>{u("basket_viewed",se.current)},[u]);let he=Math.max(1,Math.ceil(Ze.length/il)),Ae=Math.min(Q,he),Ke=Ze.slice((Ae-1)*il,Ae*il);return y?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,q.jsx)("h1",{children:"Quote requested"}),(0,q.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,q.jsx)("strong",{children:m.trim()}),", usually within one working day."]}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Start a new quote"})}),(0,q.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):!c&&g.length===0?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,q.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,q.jsx)("h1",{children:d?"Your quote request is empty":"Your basket is empty"}),(0,q.jsx)("p",{children:d?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Back to start"})})]})}):(0,q.jsx)("div",{className:`wizard-step entry-stage${d?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[d&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:c?"Your Selection":d?"Request a quote":"Your Basket"}),c&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:g.length})," ",g.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":d?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:ie?(0,q.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,q.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,q.jsx)("span",{children:"Calculating your quantities\u2026"})]}):g.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,q.jsx)("p",{children:"Your selection is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":d?"Quote request items":"Basket items",children:Ke.map(({item:h,pricing:E})=>{let N=S[h.lineId]??String(E.requestedAmount),X=E.requestedUnit===E.sellUnit||E.costingMode==="review",Z=E.requiredSellUnits==null||E.requestedAmount!==E.requiredSellUnits||E.requestedUnit!==E.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ga(h.description,h.productId,h.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:h.description}),Z&&E.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ue(k=>({...k,[h.lineId]:!k[h.lineId]})),"aria-expanded":!!me[h.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${me[h.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(nl,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(h.lineId),"aria-label":`Remove ${h.description}`,children:(0,q.jsx)(T_,{})})})]}),c&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:h.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:h.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:h.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[h.salesUnitSize," ",ka(h.salesUnitSizeUom,h.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:h.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[h.coverageQty," ",ka(h.coverageUom,h.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:h.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:h.roundingRule??"-"})]})]}),h.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:h.conversionNotes})]}),E.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:re[h.lineId]===Rn(h)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",M_(E)]}):Z&&me[h.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:E_(h,E)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:N,disabled:X,onChange:k=>R(L=>({...L,[h.lineId]:k.target.value})),onBlur:k=>G(h.lineId,k.target.value),onKeyDown:k=>{k.key==="Enter"&&k.target.blur()},"aria-label":`${h.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:X,onClick:()=>pe(h.lineId,parseFloat(N)||0,1),"aria-label":`Increase ${h.description} quantity`,children:(0,q.jsx)(nl,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:X,onClick:()=>pe(h.lineId,parseFloat(N)||0,-1),"aria-label":`Decrease ${h.description} quantity`,children:(0,q.jsx)(nl,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(E.requestedUnit,parseFloat(N)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:z[h.lineId]??String(E.requiredSellUnits??""),onChange:k=>A(L=>({...L,[h.lineId]:k.target.value})),onBlur:k=>vt(h.lineId,k.target.value),onKeyDown:k=>{k.key==="Enter"&&k.target.blur()},"aria-label":`${h.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ot(h.lineId,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${h.description} order quantity`,children:(0,q.jsx)(nl,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ot(h.lineId,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${h.description} order quantity`,children:(0,q.jsx)(nl,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(E.sellUnit,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:E.lineTotal!=null?ot(E.lineTotal):"-"}),E.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},h.lineId)})}),he>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Ae-1)*il+1,"\u2013",Math.min(Ae*il,Ze.length)," of ",Ze.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>K(Ae-1),disabled:Ae===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",Ae," of ",he]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>K(Ae+1),disabled:Ae===he,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:d?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:d?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:Ne==null?"To confirm":ot(Ne)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:ye==null?"To confirm":ot(ye)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:d?"List price (inc.\xA0VAT)":"Total"}),(0,q.jsx)("span",{children:Ee==null?"To confirm":ot(Ee)})]}),!d&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:Be,onChange:h=>Ge(h.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:ke,onChange:h=>we(h.target.value),disabled:!Be,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:d?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:m,onChange:h=>{b(h.target.value),d&&v("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&w===gv,"aria-describedby":d&&w?`${p}-basket-reference-error`:void 0}),d&&w&&(0,q.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:w}),d?(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Ut()},disabled:D||M>0||O>0,"aria-busy":D,children:(0,q.jsx)("span",{children:D?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{u("downloaded",{type:"basket",items:g.length}),cv(g)},"aria-label":c?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:c?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),d?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Na=Y(ee()),qd="metron-quick-quote",z_=1440*60*1e3;function ac(e){return(0,Na.jsx)(ec,{children:(0,Na.jsx)(A_,{...e})})}function A_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,Le.useState)("entry"),[n,o]=(0,Le.useState)(null),[l,c]=(0,Le.useState)(""),p=(0,Le.useRef)(null),d=(0,Le.useRef)(0),[g,m]=(0,Le.useState)(0),[b,y]=(0,Le.useState)(null),[T,D]=(0,Le.useState)(!1),{cart:f,addToCart:u,addManyToCart:w,removeFromCart:v,updateCartQty:S,updateCartSellUnits:R,updateCartConversions:z,clearCart:A}=Un(),[Q,K]=(0,Le.useState)(!1),[me,Ue]=(0,Le.useState)(null),Be=()=>{Ue(null);try{window.sessionStorage.removeItem(Js)}catch{}},Ge=(0,Le.useRef)(null),ke=Ys("quick-quote",Ge);(0,Le.useEffect)(()=>{ke("viewed")},[ke]);let[we,re]=(0,Le.useState)(!1);(0,Le.useEffect)(()=>{let Ne=window.location.hash,ye=null;try{ye=JSON.parse(window.sessionStorage.getItem(qd)??"null")}catch{}if(ye&&!(Date.now()-(ye.savedAt??0)<z_)&&(ye=null),ye?.scheduleResult)o("schedule"),y(ye.scheduleResult),D(ye.reviewGateComplete),K(ye.cartSeeded),w(Object.values(ye.cart)),Ne==="#quote-request"?i("basket"):Ne==="#matched-products"&&i("results");else if(Ne==="#matched-products"||Ne==="#quote-request"){let Ee=new URL(window.location.href);Ee.hash="",window.history.replaceState(window.history.state,"",Ee)}re(!0)},[]),(0,Le.useEffect)(()=>{if(we)try{b?window.sessionStorage.setItem(qd,JSON.stringify({savedAt:Date.now(),scheduleResult:b,reviewGateComplete:T,cartSeeded:Q,cart:f})):window.sessionStorage.removeItem(qd)}catch{}},[we,b,T,Q,f]);let ue=(0,Le.useCallback)(Ne=>{if(typeof window>"u")return;let ye=new URL(window.location.href);ye.hash=Ne==="basket"?"quote-request":"matched-products";let Ee=Ne==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");window.history[Ee?"replaceState":"pushState"]({boqQuoteStage:Ne},"",ye)},[]),ve=(0,Le.useRef)(!1);(0,Le.useEffect)(()=>{let Ne=ye=>{ve.current=!1;let Ee=window.location.hash;Ee==="#quote-request"?i("basket"):Ee==="#matched-products"&&b?(o("schedule"),i("results")):i("entry");let M=ye.state,O=window.location.href;setTimeout(()=>{if(window.location.href===O){if(Ee==="#quote-request"||Ee==="#matched-products"||Ee==="#quote-entry"){window.history.replaceState({boqQuoteStage:Ee==="#quote-request"?"basket":Ee==="#quote-entry"?"entry":"results"},"",O);return}!M?.turbo&&window.history.state?.turbo&&window.history.replaceState(M,"",O)}})};return window.addEventListener("popstate",Ne),()=>window.removeEventListener("popstate",Ne)},[b]);let ut=(0,Le.useCallback)(()=>{ue("basket"),i("basket")},[ue]),G=(0,Le.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(ve.current)return;ve.current=!0,window.history.back();return}i(b?"results":"entry")},[b]),pe=(0,Le.useRef)(r);(0,Le.useEffect)(()=>{pe.current!==r&&(pe.current=r,window.scrollTo(0,0))},[r]);let Te=()=>{i("entry"),o(null),c(""),m(0),y(null),D(!1),A(),K(!1),Be()},vt=(0,Le.useCallback)(async(Ne,ye,Ee=!0)=>{let M=++d.current;c(""),m(0);let O=0,ie=()=>{O=Math.min(O+1,3),m(O)};try{let{jobId:se}=await cw(Ne,ye,Ee);if(M!==d.current)return;let{promise:he,cancel:Ae}=pw(()=>uw(se),5e3,ie,"schedule");p.current=Ae;let Ke=await he;if(Ke.status==="failed"||!Ke.result)throw new Error(Ke.error||"Failed to process schedule");let h=Ke.result.lineItems.length,E=Ke.result.results.filter(N=>N.candidates.length>0).length;ke("results_shown",{lines:h,matched:E,unmatched:h-E}),A(),K(!1),D(!1),y(Ke.result),ue("results"),i("results")}catch(se){if(M!==d.current)return;ke("error",{stage:"matching"}),c(se?.message||"Failed to process schedule"),i("entry")}finally{M===d.current&&(p.current?.(),p.current=null)}},[ue,ke,A]),Ot=(0,Le.useCallback)(()=>{d.current++,p.current?.(),p.current=null},[]),Ut=(0,Le.useCallback)(async(Ne,ye,Ee=!0)=>{if(!Ne.trim())return;o("schedule");let M=new File([Ne],"pasted-schedule.txt",{type:"text/plain"});await vt(M,ye,Ee)},[vt]),Ze=(0,Le.useCallback)(async Ne=>{o("schedule"),await vt(Ne)},[vt]);return(0,Na.jsx)(Po.Provider,{value:ke,children:(0,Na.jsx)("div",{ref:Ge,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:jt().theme,children:(0,Na.jsxs)("main",{className:"main-content",children:[l&&(0,Na.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Na.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Na.jsx)(gd,{onPasteSchedule:Ut,onUploadSchedule:Ze,onEntryModeChange:o,draft:me,onSubmitDraft:Ue,onCancelMatch:Ot}),r==="results"&&n==="schedule"&&b&&(0,Na.jsx)(Nd,{scheduleResult:b,onStartOver:Te,cart:f,onAddToCart:u,onRemoveFromCart:v,onGoToBasket:ut,cartSeeded:Q,onCartSeeded:()=>K(!0),reviewGateComplete:T,onReviewGateComplete:()=>D(!0),internal:a}),r==="basket"&&(0,Na.jsx)(ol,{cart:f,onUpdateQty:S,onUpdateSellUnits:R,onResolveConversions:z,onRemove:v,onBack:G,onStartNewQuote:Te,onQuoteRequested:()=>{y(null),D(!1),K(!1),A(),Be()},internal:a})]})})})}var Xa=Y(Ye());var _i=Y(Ye()),W=Y(ee()),bv=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],rc=e=>Number.parseFloat(e)||0,wv=(e,t)=>rc(e)*(t==="m"?1:.3048),Ed=(e,t)=>rc(e.quantity)*(2*wv(e.height,t)+wv(e.width,t)),R_=()=>({quantity:"1",width:"",height:""});function U_({profile:e}){return(0,W.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,W.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,W.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Md({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,_i.useState)("m"),[n,o]=(0,_i.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,_i.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,d]=(0,_i.useState)([]),[g,m]=(0,_i.useState)("ogee"),[b,y]=(0,_i.useState)("2.4"),T=(S,R,z)=>{S(A=>({...A,[R]:z}))},D=Ed(n,r)+Ed(l,r)+p.reduce((S,R)=>S+Ed(R,r),0),f=rc(b)>0?Math.ceil(D/rc(b)):0,u=bv.find(S=>S.id===g)?.label??"",w=[{key:`architrave-${g}`,label:`Architrave (${u})`,qty:D,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(S,R,z,A)=>(0,W.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,W.jsx)("span",{children:S}),(0,W.jsx)("input",{"aria-label":`${S} quantity`,type:"number",min:"0",step:"1",value:R.quantity,onChange:Q=>z("quantity",Q.target.value)}),(0,W.jsx)("input",{"aria-label":`${S} width`,type:"number",min:"0",step:"0.01",value:R.width,onChange:Q=>z("width",Q.target.value)}),(0,W.jsx)("input",{"aria-label":`${S} height`,type:"number",min:"0",step:"0.01",value:R.height,onChange:Q=>z("height",Q.target.value)}),A?(0,W.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:A,children:"Remove"}):null]});return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"truss-estimator",children:[(0,W.jsxs)("div",{className:"quick-order-hero",children:[(0,W.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,W.jsx)("h1",{children:"Architrave Calculator"}),(0,W.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,W.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,W.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,W.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,W.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,W.jsx)("span",{children:"Units"}),(0,W.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,W.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,W.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,W.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,W.jsx)("span",{children:"Opening"}),(0,W.jsx)("span",{children:"Qty"}),(0,W.jsxs)("span",{children:["Width (",r,")"]}),(0,W.jsxs)("span",{children:["Height (",r,")"]}),(0,W.jsx)("span",{})]}),v("Single doors",n,(S,R)=>T(o,S,R)),v("Double doors",l,(S,R)=>T(c,S,R)),p.map((S,R)=>v(`Alternative door ${R+1}`,S,(z,A)=>d(Q=>Q.map((K,me)=>me===R?{...K,[z]:A}:K)),()=>d(z=>z.filter((A,Q)=>Q!==R)))),(0,W.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(S=>[...S,R_()]),children:"+ Add alternative-sized door"})]}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,W.jsx)("div",{className:"architrave-calculator__profiles",children:bv.map(S=>(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===S.id?" is-selected":""}`,onClick:()=>m(S.id),children:[(0,W.jsx)(U_,{profile:S.id}),(0,W.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,W.jsx)("div",{className:"architrave-calculator__options",children:(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsx)("span",{children:"Board length (m)"}),(0,W.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,W.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,W.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Architrave needed"}),(0,W.jsxs)("strong",{children:[D.toFixed(2)," m"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Board lengths"}),(0,W.jsx)("strong",{children:f})]})]})]}),(0,W.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,W.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,W.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:D<=0,children:a})]})]})]})})}var xi=Y(Ye()),oe=Y(ee()),vv=60,yv=10,D_=.02,O_=.012,B_=.01,Dn=e=>Number.parseFloat(e)||0,L_=(e,t=2)=>e.toFixed(t);function Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,xi.useState)("brick"),[n,o]=(0,xi.useState)("engineering-red"),[l,c]=(0,xi.useState)("metric"),[p,d]=(0,xi.useState)(""),[g,m]=(0,xi.useState)(""),[b,y]=(0,xi.useState)(!0),T=l==="metric"?Dn(p)*Dn(g):Dn(p)*Dn(g)*.092903,f=T*(r==="brick"?vv:yv),u=Math.ceil(f),w=T*(r==="brick"?D_:O_),v=Math.ceil(w/B_),S=l==="metric"?T:T*10.7639,R=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],z=A=>{if(A===l)return;let Q=A==="imperial"?3.28084:.3048;d((Dn(p)*Q).toFixed(2)),m((Dn(g)*Q).toFixed(2)),c(A)};return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Brick and Block Calculator"}),(0,oe.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,oe.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([A,Q])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===A?" is-selected":""}`,onClick:()=>i(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,oe.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",A==="brick"?vv:yv," per m\xB2"]})]},A))})]}),r==="brick"&&(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([A,Q,K])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===A?" is-selected":""}`,onClick:()=>o(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:K})]},A))})]}),(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,oe.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,oe.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>z("metric"),children:"Metric"}),(0,oe.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>z("imperial"),children:"Imperial"})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:A=>d(A.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:A=>m(A.target.value)})]})]})]}),(0,oe.jsx)("div",{className:"brick-calculator__options",children:(0,oe.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,oe.jsx)("input",{type:"checkbox",checked:b,onChange:A=>y(A.target.checked)}),(0,oe.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,oe.jsxs)("div",{className:"brick-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Wall area"}),(0,oe.jsxs)("strong",{children:[L_(S)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,oe.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Ready-mixed mortar"}),(0,oe.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,oe.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,oe.jsxs)("div",{className:"brick-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(R),disabled:T<=0,children:a})]})]})]})})}var hr=Y(Ye());var H_={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501",mortar:"646"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-ovolo":"1531","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},insulation:{"insulation-floor":"152187","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142",gate:"1984","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"23995","surface-raj":"12369","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function zd(e,t){let a=H_[jt().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function _v(e,t){let a=t.map(r=>{let i=zd(e,r);return i?{key:r.key,productId:i.split(" ")[0],search:i,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var xv=new Map;function j_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function fr(e,t,a=12,r){let i=`${jt().client??""}||${e}||${t??""}||${a}||${r??""}`,n=xv.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(za(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Qa(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(j_):[];return xv.set(i,p),p}var Q_=new Set(["bag","box","roll","pack"]),G_=new Set(["each","bag","box","roll","pack","tub"]);function Ad(e,t){let a=t?.uoi,r=a!=null&&G_.has(a.toLowerCase())&&(t?.uoi_count??1)===1;return Q_.has(e)&&r?a:e}async function kv(e,t,a){return await Promise.all(e.map(async i=>{try{let n=a?zd(a,i):null,[o,l]=await Promise.all([n?fr(n,void 0,void 0,t).then(p=>p.find(d=>d.product_id===n.split(" ")[0]),()=>{}):void 0,fr(i.query,i.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:{...i,unit:Ad(i.unit,c[0])},candidates:c}}catch{return{requirement:i,candidates:[]}}}))}async function Nv(){let e=await fetch(za("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Qa(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var V=Y(ee()),Y_=1.54,X_=1440,V_=25,Rd=800,$_=1500,Ud=e=>Number.parseFloat(e)||0,On={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function Dd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=tc(),[i,n]=(0,hr.useState)("m"),[o,l]=(0,hr.useState)(""),[c,p]=(0,hr.useState)(""),[d,g]=(0,hr.useState)(""),[m,b]=(0,hr.useState)("concrete"),[y,T]=(0,hr.useState)("mot"),[D,f]=(0,hr.useState)(!1),[u,w]=(0,hr.useState)(null),v=i==="m"?1:.3048,S=Ud(o)*v*Ud(c)*v*Ud(d)*(i==="m"?.01:.0254),R=On[y],z=S*Y_/7,A=z*X_,Q=z*2,K=z*4,me=Math.ceil(A/V_),Ue=Math.ceil(Q*On["sharp-sand"].density*1e3/Rd),Be=Math.ceil(K*On.gravel.density*1e3/Rd),Ge=Math.ceil(S*R.density*1e3/Rd),ke=m==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:me,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Ue,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:Be,productId:"6001004"}]:[{key:y,label:`${R.label} Bulk Bag (800kg)`,qty:Ge,productId:R.productId}],we=()=>{if(t){t(ke.map(ue=>({key:ue.key,label:ue.label,qty:ue.qty,unit:"each",query:ue.productId})));return}re()},re=async()=>{let ue=Date.now();f(!0),w(null);try{let ve=await Promise.all(ke.map(async G=>{let pe=(await fr(G.productId)).find(Te=>Te.product_id===G.productId);if(!pe)throw new Error(`${G.label} is no longer available in this catalogue.`);return Kr(pe,{lineId:`concrete-aggregate:${G.key}`,description:G.label,unit:"bag",qty:G.qty})})),ut=$_-(Date.now()-ue);ut>0&&await new Promise(G=>window.setTimeout(G,ut)),r?.clearCart(),r?.addManyToCart(ve),r?.openBasket()}catch(ve){w(ve instanceof Error?ve.message:"Could not add the products to your basket.")}finally{f(!1)}};return D?(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Your Materials"}),(0,V.jsx)("p",{children:"Calculating quantities from the Concrete and Aggregate Calculator."})]}),(0,V.jsx)("div",{className:"truss-estimator__card",children:(0,V.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,V.jsx)(dr,{}),(0,V.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,V.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,V.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,V.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,V.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,V.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="concrete"?" is-selected":""}`,onClick:()=>b("concrete"),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="aggregate"?" is-selected":""}`,onClick:()=>b("aggregate"),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),m==="aggregate"&&(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,V.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(On).map(ue=>(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${y===ue?" is-selected":""}`,onClick:()=>T(ue),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:On[ue].label}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:On[ue].blurb})]},ue))})]}),(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,V.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,V.jsx)("span",{children:"Units"}),(0,V.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,V.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metric"}),(0,V.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Imperial"})]})]}),(0,V.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsxs)("span",{children:["Length (",i,")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ue=>l(ue.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsxs)("span",{children:["Width (",i,")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ue=>p(ue.target.value)})]})]}),(0,V.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,V.jsxs)("span",{children:["Depth (",i==="m"?"cm":"inches",")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.1",value:d,onChange:ue=>g(ue.target.value)})]})]}),(0,V.jsxs)("div",{className:"materials-calculator__totals",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,V.jsx)("div",{className:"materials-calculator__result-grid",children:m==="concrete"?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Cement"}),(0,V.jsxs)("strong",{children:[A.toFixed(0)," kg"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Sharp sand"}),(0,V.jsxs)("strong",{children:[Q.toFixed(2)," m\xB3"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"20mm aggregate"}),(0,V.jsxs)("strong",{children:[K.toFixed(2)," m\xB3"]})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:R.label}),(0,V.jsxs)("strong",{children:[S.toFixed(2)," m\xB3"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Approx. weight"}),(0,V.jsxs)("strong",{children:[(S*R.density).toFixed(2)," t"]})]}),(0,V.jsx)("div",{})]})}),(0,V.jsx)("p",{className:"materials-calculator__note",children:m==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),u&&(0,V.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,V.jsxs)("div",{className:"materials-calculator__actions",children:[(0,V.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,V.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:we,disabled:S<=0||D,children:D?"Adding products\u2026":a})]})]})]})})}var Ya=Y(Ye());var U=Y(ee()),Bn=12,Ln=8,ic=.56,Sv=.21,Aa={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},ki=["range","grid","pictureFrame","substructure"],Z_={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},nc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),oc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),K_=(e,t,a,r)=>{let i=nc(e,t,a),n=nc(e,t,r),o=nc(a,r,e),l=nc(a,r,t);return i===0&&oc(e,t,a)||n===0&&oc(e,t,r)||o===0&&oc(a,r,e)||l===0&&oc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Od=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&K_(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Bd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ya.useState)(0),[n,o]=(0,Ya.useState)(Z_),[l,c]=(0,Ya.useState)(1),[p,d]=(0,Ya.useState)({x:0,y:0}),[g,m]=(0,Ya.useState)(null),b=(0,Ya.useRef)(null),y=(0,Ya.useRef)(null),T=(0,Ya.useRef)(null),D=ki[r],f=n.range?Aa.ranges[n.range]:null,u=Bn/l,w=Ln/l,v=(Bn-u)/2,S=(Ln-w)/2,R=Math.max(-Bn,Math.min(Bn*2-u,v+p.x)),z=Math.max(-Ln,Math.min(Ln*2-w,S+p.y)),A=Number.parseFloat(n.quickLengthM),Q=Number.parseFloat(n.quickWidthM),K=A>0&&Q>0,me=M=>Math.abs(M.reduce((O,ie,se)=>{let he=M[(se+1)%M.length];return O+ie.x*he.y-he.x*ie.y},0))/2,Ue=(M,O)=>Math.hypot(O.x-M.x,O.y-M.y),Be=n.isOutlineClosed?me(n.points):0,Ge=n.isOutlineClosed?n.points.reduce((M,O,ie)=>M+Ue(O,n.points[(ie+1)%n.points.length]),0):0,ke=n.isOutlineClosed?n.points.reduce((M,O,ie)=>M+(n.wallSegments.has(ie)?0:Ue(O,n.points[(ie+1)%n.points.length])),0):0,we=n.points.reduce((M,O)=>({x:M.x+O.x/n.points.length,y:M.y+O.y/n.points.length}),{x:0,y:0}),re=n.points.length>1?(()=>{let M=n.points[0],O=n.points[1],ie=Ue(M,O),se=ie?-(O.y-M.y)/ie:0,he=ie?(O.x-M.x)/ie:0,Ae=(M.x+O.x)/2,Ke=(M.y+O.y)/2,h=se*(Ae-we.x)+he*(Ke-we.y)>=0?1:-1;return{x:Ae+se*ic*h,y:Ke+he*ic*h}})():null,ve=(()=>{let M=n.range?Aa.ranges[n.range]:Aa.ranges.meridian,O=n.deckSizeMode==="quick"?A*Q:Be,ie=n.deckSizeMode==="quick"?2*(A+Q):ke,se=n.direction==="diagonal"?Aa.wastage.diagonal:Aa.wastage.straight,he=n.pictureFrame==="yes"?Aa.pictureFrame.extraWastage:0,Ke=O/(M.boardWidthM+Aa.boardGapM)/M.boardLengthM,h=Math.ceil(Ke*(1+se+he)),E=Math.ceil(O*30*(1+se+he)/200),N=Aa.joist.spacingOptions.find(k=>k.id===n.joistSpacing)??Aa.joist.spacingOptions[1],X=O/N.spacingM,Z=Math.ceil(X);return{range:M,area:O,boardCount:h,screwBoxes:E,joistMetres:Z,spacing:N}})(),ut=ve?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${ve.range.label})`,qty:ve.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ve.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ve.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],G=()=>D==="range"?!!n.range:D==="grid"?n.deckSizeMode==="quick"?K:n.isOutlineClosed&&Be>0:D==="pictureFrame"?!!n.pictureFrame&&!!n.direction:D==="substructure"?!!n.joistSpacing:!0,pe=r===ki.length-1?a:"Next",Te=(M,O,ie=!1)=>{let se=T.current?.getBoundingClientRect();if(!se)return null;let he=ie?1:.25;return{x:Math.round(Math.max(R,Math.min(R+u,R+(M-se.left)/se.width*u))/he)*he,y:Math.round(Math.max(z,Math.min(z+w,z+(O-se.top)/se.height*w))/he)*he}},vt=M=>{if(n.isOutlineClosed){let ie=M.target;if(ie!==M.currentTarget&&!ie.classList.contains("deck-outline__grid"))return;y.current={startX:M.clientX,startY:M.clientY,startViewX:R,startViewY:z},M.currentTarget.setPointerCapture(M.pointerId);return}if(n.drawMode!=="outline")return;let O=Te(M.clientX,M.clientY,!0);O&&(m(null),o(ie=>{let se=[...ie.points,O];return Od(se,!1)?{...ie,drawError:"Edges cannot cross. Choose another corner."}:{...ie,points:se,drawError:""}}))},Ot=(M,O)=>{if(!n.isOutlineClosed){M.stopPropagation(),O===0&&n.points.length>=3&&o(ie=>({...ie,isOutlineClosed:!0,drawMode:"edges"}));return}M.stopPropagation(),b.current=O,M.currentTarget.setPointerCapture(M.pointerId)},Ut=M=>{if(y.current){let se=T.current?.getBoundingClientRect();if(!se)return;let he=y.current,Ae=he.startViewX-(M.clientX-he.startX)/se.width*u,Ke=he.startViewY-(M.clientY-he.startY)/se.height*w;d({x:Ae-v,y:Ke-S});return}!n.isOutlineClosed&&n.drawMode==="outline"&&m(Te(M.clientX,M.clientY,!0));let O=b.current;if(O===null)return;let ie=Te(M.clientX,M.clientY);ie&&o(se=>{let he=se.points.map((Ae,Ke)=>Ke===O?ie:Ae);return Od(he,!0)?{...se,drawError:"Edges cannot cross. Move the corner to a different position."}:{...se,points:he,drawError:""}})},Ze=M=>{y.current=null,b.current=null,M.currentTarget.hasPointerCapture(M.pointerId)&&M.currentTarget.releasePointerCapture(M.pointerId)},Ne=M=>{o(O=>{let ie=new Set(O.wallSegments);return ie.has(M)?ie.delete(M):ie.add(M),{...O,wallSegments:ie}})},ye=()=>{r===0?e():i(M=>M-1)},Ee=()=>{G()&&(r===ki.length-1?t?.(ut):i(M=>M+1))};return(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)("div",{className:"truss-estimator",children:[(0,U.jsxs)("div",{className:"quick-order-hero",children:[(0,U.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,U.jsx)("h1",{children:"Decking Calculator"}),(0,U.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,U.jsxs)("div",{className:"truss-estimator__card",children:[(0,U.jsxs)("div",{className:"truss-estimator__body",children:[D==="range"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Aa.ranges).map(([M,O])=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===M?" is-selected":""}`,onClick:()=>o(ie=>({...ie,range:M})),children:[(0,U.jsx)("div",{className:"truss-estimator__option-title",children:O.label}),(0,U.jsx)("div",{className:"truss-estimator__option-copy",children:O.blurb}),(0,U.jsxs)("div",{className:"truss-estimator__option-copy",children:[O.boardLengthM,"m boards"]})]},M))})]}):null,D==="grid"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,U.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(M=>({...M,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(M=>({...M,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Length (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:M=>o(O=>({...O,quickLengthM:M.target.value}))})]}),(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Width (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:M=>o(O=>({...O,quickWidthM:M.target.value}))})]})]}),(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),K?(0,U.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,U.jsxs)("div",{children:[(A*Q).toFixed(2)," m\xB2 deck"]}),(0,U.jsxs)("div",{children:[(2*(A+Q)).toFixed(2)," m perimeter"]})]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,U.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,U.jsxs)("div",{className:"deck-outline__summary",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Deck area"}),(0,U.jsxs)("strong",{children:[Be.toFixed(2)," m\xB2"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Perimeter"}),(0,U.jsxs)("strong",{children:[Ge.toFixed(2)," m"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Wall edges"}),(0,U.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Visible edge"}),(0,U.jsxs)("strong",{children:[ke.toFixed(2)," m"]})]})]}):null,(0,U.jsxs)("div",{className:"deck-outline__actions",children:[(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(M=>({...M,points:M.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m(null),o(M=>({...M,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(M=>({...M,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,U.jsx)("div",{className:"deck-editor-layout",children:(0,U.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,U.jsxs)("div",{className:"deck-outline",children:[(0,U.jsxs)("svg",{ref:T,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${R} ${z} ${u} ${w}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:vt,onPointerMove:Ut,onPointerUp:Ze,onPointerLeave:()=>{m(null),y.current||(b.current=null)},children:[(0,U.jsx)("defs",{children:(0,U.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,U.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,U.jsx)("rect",{x:-Bn,y:-Ln,width:Bn*3,height:Ln*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,U.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(M=>`${M.x},${M.y}`).join(" ")}):null,n.isOutlineClosed?(0,U.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(M=>`${M.x},${M.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((M,O)=>{let ie=n.points[n.isOutlineClosed?(O+1)%n.points.length:O+1],se=Ue(M,ie),he=se?-(ie.y-M.y)/se:0,Ae=se?(ie.x-M.x)/se:0,Ke=(M.x+ie.x)/2,h=(M.y+ie.y)/2,E=he*(Ke-we.x)+Ae*(h-we.y)>=0?1:-1,N=Ke+he*ic*E,X=h+Ae*ic*E;return(0,U.jsxs)("g",{children:[(0,U.jsx)("line",{className:"deck-outline__edge-hit",x1:M.x,y1:M.y,x2:ie.x,y2:ie.y,onClick:n.isOutlineClosed?()=>Ne(O):void 0}),(0,U.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(O)?" is-wall":""}`,x1:M.x,y1:M.y,x2:ie.x,y2:ie.y,pointerEvents:"none"}),(0,U.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(O)?" is-wall":""}`,x:N,y:X,textAnchor:"middle",dominantBaseline:"central",fontSize:Sv/l,children:[se.toFixed(2)," m"]})]},`segment-${O}`)}):null,!n.isOutlineClosed&&n.points.length>0&&g?(()=>{let M=n.points[n.points.length-1],O=Ue(M,g);if(!O)return null;let ie=-(g.y-M.y)/O,se=(g.x-M.x)/O,he=(M.x+g.x)/2,Ae=(M.y+g.y)/2;return(0,U.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,U.jsx)("line",{x1:M.x,y1:M.y,x2:g.x,y2:g.y}),(0,U.jsxs)("text",{x:he+ie*.34,y:Ae+se*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:Sv/l,children:[O.toFixed(2)," m"]})]})})():null,n.points.map((M,O)=>(0,U.jsx)("circle",{className:"deck-outline__point",cx:M.x,cy:M.y,r:"0.13",onPointerDown:ie=>Ot(ie,O)},`point-${O}`))]}),(0,U.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,U.jsx)("button",{type:"button",onClick:()=>c(M=>Math.max(.5,M-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,U.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,U.jsx)("button",{type:"button",onClick:()=>c(M=>Math.min(1,M+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&re?(0,U.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(re.x-R)/u*100}%`,top:`${(re.y-z)/w*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,U.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(M=>Od(M.points,!0)?{...M,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...M,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,U.jsxs)("div",{className:"deck-outline__supporting",children:[(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,U.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,D==="pictureFrame"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(M=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===M.id?" is-selected":""}`,onClick:()=>o(O=>({...O,pictureFrame:M.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(M.img),alt:""}),(0,U.jsx)("span",{children:M.label})]},M.id))}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(M=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===M.id?" is-selected":""}`,onClick:()=>o(O=>({...O,direction:M.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(M.img),alt:""}),(0,U.jsx)("span",{children:M.label})]},M.id))})]})]}):null,D==="substructure"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Aa.joist.spacingOptions.map(M=>(0,U.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===M.id?" is-selected":""}`,onClick:()=>o(O=>({...O,joistSpacing:M.id})),children:(0,U.jsx)("div",{className:"truss-estimator__option-title",children:M.label})},M.id))})]}):null]}),(0,U.jsxs)("div",{className:"truss-estimator__nav",children:[(0,U.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ye,children:"Back"}),(0,U.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:Ee,disabled:!G(),children:[(0,U.jsx)("span",{children:pe}),(0,U.jsx)("span",{className:"arrow",children:(0,U.jsx)(Qt,{})})]})]})]})]})})}var Ca=Y(Ye());var j=Y(ee()),Cv=12,qv=30,Hn=12,jn=8,Ev=.56,Sa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ni=["range","height","gate","posts"],P_={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},lc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),sc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),J_=(e,t,a,r)=>{let i=lc(e,t,a),n=lc(e,t,r),o=lc(a,r,e),l=lc(a,r,t);return i===0&&sc(e,t,a)||n===0&&sc(e,t,r)||o===0&&sc(a,r,e)||l===0&&sc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},cc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&J_(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function Ld({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ca.useState)(0),[n,o]=(0,Ca.useState)(P_),l=(0,Ca.useRef)(null),c=(0,Ca.useRef)(null),[p,d]=(0,Ca.useState)(1),[g,m]=(0,Ca.useState)({x:0,y:0}),[b,y]=(0,Ca.useState)(null),T=(0,Ca.useRef)(null),D=(0,Ca.useRef)(null),f=(0,Ca.useRef)(null),u=Ni[r],w=n.range?Sa.ranges[n.range]:null,v=Hn/p,S=jn/p,R=(Hn-v)/2,z=(jn-S)/2,A=Math.max(-Hn,Math.min(Hn*2-v,R+g.x)),Q=Math.max(-jn,Math.min(jn*2-S,z+g.y)),K=n.boundaryPoints.reduce((h,E)=>({x:h.x+E.x/Math.max(1,n.boundaryPoints.length),y:h.y+E.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),me=h=>{let E=new Set,N=[];return h.forEach(X=>{let[Z,k]=X.split(",").map(Number),L=[{key:`H,${Z},${k}`,type:"H",x:Z,y:k},{key:`H,${Z},${k+1}`,type:"H",x:Z,y:k+1},{key:`V,${Z},${k}`,type:"V",x:Z,y:k},{key:`V,${Z+1},${k}`,type:"V",x:Z+1,y:k}],P=[!h.has(`${Z},${k-1}`),!h.has(`${Z},${k+1}`),!h.has(`${Z-1},${k}`),!h.has(`${Z+1},${k}`)];L.forEach((ce,_e)=>{P[_e]&&!E.has(ce.key)&&(E.add(ce.key),N.push(ce))})}),N},Ue=(h,E)=>me(h).filter(N=>!E.has(N.key)),Be=(h,E)=>Ue(h,E).length,Ge=(h,E)=>{let N={};Ue(h,E).forEach(Z=>{var k,L,P,ce;Z.type==="H"?((N[k=`${Z.x},${Z.y}`]||(N[k]=[])).push("H"),(N[L=`${Z.x+1},${Z.y}`]||(N[L]=[])).push("H")):((N[P=`${Z.x},${Z.y}`]||(N[P]=[])).push("V"),(N[ce=`${Z.x},${Z.y+1}`]||(N[ce]=[])).push("V"))});let X=0;return Object.values(N).forEach(Z=>{(Z.length===1||Z.length===2&&Z[0]!==Z[1]||Z.length>=3)&&(X+=1)}),X},we=(()=>{let h=n.range?Sa.ranges[n.range]:Sa.ranges.boundary,E=n.height??"1.8",N=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Yt,br,_t)=>Yt+(n.excludedBoundaryEdges.has(_t)?0:Math.hypot(n.boundaryPoints[_t+1].x-br.x,n.boundaryPoints[_t+1].y-br.y)),0):0,X=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||Sa.gate[n.gateType].widthDefault:0,Z=Math.max(0,N-X),k=Z>0?Math.ceil(Z/h.panelWidthM):0,L=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,P=n.boundaryMode==="quick"?Z>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,L?-1:void 0).reduce((Yt,br,_t)=>{let Ci=_t>0&&!n.excludedBoundaryEdges.has(_t-1),am=_t<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has(_t);return Yt+(Ci||am?1:0)},0):0,ce=Z>0?Math.ceil(Z/h.panelWidthM)+1:0,_e=Math.max(0,ce-P),yt=n.mountingType?Sa.mounting[n.mountingType]:Sa.mounting.concrete,rt=n.gateType&&n.gateType!=="none"?2:0,Ct=_e+P+rt,tm=n.mountingType==="postcrete"?Ct*Sa.mounting.postcrete.bagsPerPost:0,Jr=n.gravelBoard==="yes"?k:0;return{range:h,height:E,totalEdgeM:N,fencedLengthM:Z,gateWidthM:X,panelsCount:k,cornerPostCount:P,intermediatePostCount:_e,gatePostCount:rt,totalPostCount:Ct,bagsCount:tm,gravelCount:Jr,capCount:Ct,mounting:yt}})(),re=n.gateType&&n.gateType!=="none"?Sa.gate[n.gateType].label:null,ue=Number(we.height)<=1.2?"6":"8",ve=we?[{key:`panels-${n.range??"boundary"}-${we.height}`,label:`${we.range.label} panels (${we.height}m)`,qty:we.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${ue}`,label:"Intermediate concrete posts",qty:we.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ue}`,label:"End and corner concrete posts",qty:we.cornerPostCount+we.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ue}`,label:"Timber fence posts",qty:we.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:we.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...re?[{key:"gate",label:re,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...we.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:we.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ut=()=>{if(u==="range"){let h=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&h}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},G=r===Ni.length-1?a:"Next",pe=h=>{o(E=>{let N=h(new Set(E.grid)),X=new Set([...E.excludedEdges].filter(Z=>me(N).some(k=>k.key===Z)));return{...E,grid:N,excludedEdges:X}})},Te=(h,E,N)=>{pe(X=>{let Z=`${h},${E}`;return N?X.add(Z):X.delete(Z),X})},vt=(h,E,N,X,Z)=>{let k=h,L=E,P=Math.abs(N-h),ce=h<N?1:-1,_e=-Math.abs(X-E),yt=E<X?1:-1,rt=P+_e;for(;Te(k,L,Z),!(k===N&&L===X);){let Ct=2*rt;Ct>=_e&&(rt+=_e,k+=ce),Ct<=P&&(rt+=P,L+=yt)}},Ot=(h,E)=>{let N=c.current?.getBoundingClientRect();if(!N)return null;let X=Math.floor((h-N.left)/qv),Z=Math.floor((E-N.top)/qv);return X<0||Z<0||X>=Cv||Z>=Cv?null:{x:X,y:Z}},Ut=h=>{if(n.gridMode!=="draw")return;let E=Ot(h.clientX,h.clientY);if(!E)return;h.preventDefault();let N=`${E.x},${E.y}`,X=!n.grid.has(N);l.current={active:!0,paintValue:X,lastX:E.x,lastY:E.y},h.currentTarget.setPointerCapture(h.pointerId),Te(E.x,E.y,X)},Ze=h=>{let E=l.current;if(!E?.active)return;let N=Ot(h.clientX,h.clientY);N&&(N.x===E.lastX&&N.y===E.lastY||(vt(E.lastX,E.lastY,N.x,N.y,E.paintValue),l.current={...E,lastX:N.x,lastY:N.y}))},Ne=h=>{l.current?.active&&(l.current=null,h.currentTarget.releasePointerCapture(h.pointerId))},ye=(h,E,N=!1)=>{let X=f.current?.getBoundingClientRect();if(!X)return null;let Z=N?1:.25;return{x:Math.round(Math.max(A,Math.min(A+v,A+(h-X.left)/X.width*v))/Z)*Z,y:Math.round(Math.max(Q,Math.min(Q+S,Q+(E-X.top)/X.height*S))/Z)*Z}},Ee=h=>{if(n.boundaryClosed){let N=h.target;if(N!==h.currentTarget&&!N.classList.contains("fence-boundary__grid"))return;D.current={startX:h.clientX,startY:h.clientY,startViewX:A,startViewY:Q},h.currentTarget.setPointerCapture(h.pointerId);return}let E=ye(h.clientX,h.clientY,!0);E&&(y(null),o(N=>{let X=[...N.boundaryPoints,E];return cc(X,!1)?{...N}:{...N,boundaryPoints:X}}))},M=(h,E)=>{if(h.stopPropagation(),!n.boundaryClosed){if(E!==0||n.boundaryPoints.length<3)return;o(N=>cc(N.boundaryPoints,!0)?N:{...N,boundaryPoints:[...N.boundaryPoints,N.boundaryPoints[0]],boundaryClosed:!0});return}T.current=E,h.currentTarget.setPointerCapture(h.pointerId)},O=h=>{if(D.current){let N=f.current?.getBoundingClientRect();if(!N)return;let X=D.current,Z=X.startViewX-(h.clientX-X.startX)/N.width*v,k=X.startViewY-(h.clientY-X.startY)/N.height*S;m({x:Z-R,y:k-z});return}if(n.boundaryClosed||y(ye(h.clientX,h.clientY,!0)),T.current===null)return;let E=ye(h.clientX,h.clientY);E&&o(N=>{let X=N.boundaryPoints.length>2&&N.boundaryPoints[0].x===N.boundaryPoints[N.boundaryPoints.length-1].x&&N.boundaryPoints[0].y===N.boundaryPoints[N.boundaryPoints.length-1].y,Z=N.boundaryPoints.map((k,L)=>{let P=L===T.current,ce=X&&T.current===0&&L===N.boundaryPoints.length-1;return P||ce?E:k});return cc(Z,!1)?N:{...N,boundaryPoints:Z}})},ie=h=>{D.current=null,T.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},se=h=>{o(E=>{let N=new Set(E.excludedBoundaryEdges);return N.has(h)?N.delete(h):N.add(h),{...E,excludedBoundaryEdges:N}})},he=()=>{r===0?e():i(h=>h-1)},Ae=()=>{ut()&&(r===Ni.length-1?t?.(ve):i(h=>h+1))},Ke=me(n.grid);return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"truss-estimator",children:[(0,j.jsxs)("div",{className:"quick-order-hero",children:[(0,j.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,j.jsx)("h1",{children:"Fencing Calculator"}),(0,j.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,j.jsxs)("div",{className:"truss-estimator__card",children:[(0,j.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([h,E])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===h?" is-selected":""}`,onClick:()=>o(N=>({...N,range:h})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:E.blurb})]},h))})]}):null,u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,j.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(h=>({...h,boundaryMode:"quick"})),children:"Quick estimate"}),(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(h=>({...h,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,j.jsx)("span",{children:"Total fence length (m)"}),(0,j.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:h=>o(E=>({...E,quickLengthM:h.target.value}))})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"fence-boundary__toolbar",children:(0,j.jsxs)("div",{className:"fence-boundary__actions",children:[(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(h=>({...h,boundaryPoints:h.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m({x:0,y:0}),y(null),o(h=>({...h,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(h=>({...h,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,j.jsxs)("div",{className:"fence-boundary",children:[(0,j.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${A} ${Q} ${v} ${S}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:Ee,onPointerMove:O,onPointerUp:ie,onPointerLeave:()=>{y(null),D.current||(T.current=null)},children:[(0,j.jsx)("defs",{children:(0,j.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,j.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,j.jsx)("rect",{x:-Hn,y:-jn,width:Hn*3,height:jn*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,j.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(h=>`${h.x},${h.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((h,E)=>{let N=n.boundaryPoints[E+1],X=Math.hypot(N.x-h.x,N.y-h.y),Z=X?-(N.y-h.y)/X:0,k=X?(N.x-h.x)/X:0,L=(h.x+N.x)/2,P=(h.y+N.y)/2,ce=Z*(L-K.x)+k*(P-K.y)>=0?1:-1,_e=L+Z*Ev*ce,yt=P+k*Ev*ce;return(0,j.jsxs)("g",{children:[(0,j.jsx)("line",{className:"fence-boundary__edge-hit",x1:h.x,y1:h.y,x2:N.x,y2:N.y,onClick:n.boundaryClosed?()=>se(E):void 0}),(0,j.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(E)?" is-excluded":""}`,x1:h.x,y1:h.y,x2:N.x,y2:N.y,pointerEvents:"none"}),(0,j.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(E)?" is-excluded":""}`,x:_e,y:yt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[X.toFixed(2)," m"]})]},`fence-edge-${E}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let h=n.boundaryPoints[n.boundaryPoints.length-1],E=Math.hypot(b.x-h.x,b.y-h.y);if(!E)return null;let N=-(b.y-h.y)/E,X=(b.x-h.x)/E,Z=(h.x+b.x)/2,k=(h.y+b.y)/2;return(0,j.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,j.jsx)("line",{x1:h.x,y1:h.y,x2:b.x,y2:b.y}),(0,j.jsxs)("text",{x:Z+N*.34,y:k+X*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[E.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((h,E)=>E>0&&E===n.boundaryPoints.length-1&&h.x===n.boundaryPoints[0]?.x&&h.y===n.boundaryPoints[0]?.y?null:(0,j.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&E===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:h.x,cy:h.y,r:"0.13",onPointerDown:N=>M(N,E)},`fence-point-${E}`))]}),(0,j.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,j.jsx)("button",{type:"button",onClick:()=>d(h=>Math.max(.5,h-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,j.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,j.jsx)("button",{type:"button",onClick:()=>d(h=>Math.min(1,h+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,j.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(h=>cc(h.boundaryPoints,!1)?h:{...h,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,j.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,j.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,j.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${we.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,j.jsxs)("div",{children:[we.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Sa.heights.map(h=>(0,j.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===h?" is-selected":""}`,onClick:()=>o(E=>({...E,height:h})),children:(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${h}.webp`),alt:""})},h))}),(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(h=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===h.id?" is-selected":""}`,onClick:()=>o(E=>({...E,gravelBoard:h.id})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(h.img),alt:""}),(0,j.jsx)("span",{children:h.label})]},h.id))})]}):null,u==="gate"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(h=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===h.id?" is-selected":""}`,onClick:()=>o(E=>({...E,gateType:h.id,gateWidthM:h.id==="none"?"":String(Sa.gate[h.id].widthDefault)})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(h.img),alt:""}),(0,j.jsx)("span",{children:h.label})]},h.id))}),n.gateType&&n.gateType!=="none"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,j.jsx)("span",{children:"Gate width (m)"}),(0,j.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:h=>o(E=>({...E,gateWidthM:h.target.value}))})]}):null]}):null,u==="posts"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.mounting).map(([h,E])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===h?" is-selected":""}`,onClick:()=>o(N=>({...N,mountingType:h})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:E.blurb})]},h))})]}):null]}),(0,j.jsxs)("div",{className:"truss-estimator__nav",children:[(0,j.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:he,children:"Back"}),(0,j.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:Ae,disabled:!ut(),children:[(0,j.jsx)("span",{children:G}),(0,j.jsx)("span",{className:"arrow",children:(0,j.jsx)(Qt,{})})]})]})]})]})})}var uc=Y(Ye()),be=Y(ee()),Mv={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack",byArea:!0},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll",byArea:!0}};function Hd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,uc.useState)("floor"),[n,o]=(0,uc.useState)(""),[l,c]=(0,uc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,d=Mv[r],g=Math.ceil(p/d.coverage),m=[{key:`insulation-${r}`,label:`${d.product} ${d.thickness}`,qty:d.byArea?Math.round(p*100)/100:g,unit:d.byArea?"m2":d.salesUnit,query:d.product,category:"insulation"}],b=Object.entries(Mv);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:b.map(([y,T])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===y?" is-selected":""}`,onClick:()=>i(y),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:T.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[T.product,", ",T.thickness]})]},y))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:y=>o(y.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:y=>c(y.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:d.product}),(0,be.jsxs)("strong",{children:[g," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(m),disabled:p<=0,children:a})]})]})]})})}var Qn=Y(Ye()),$=Y(ee()),I_=10,F_=1.9*.762,W_=1.9*1.524,pc=()=>({height:"",width:""}),dc=e=>Number.parseFloat(e)||0,Tv=({height:e,width:t})=>dc(e)*dc(t);function jd({onBack:e}){let[t,a]=(0,Qn.useState)([pc()]),[r,i]=(0,Qn.useState)([pc()]),[n,o]=(0,Qn.useState)("0"),[l,c]=(0,Qn.useState)("0"),[p,d]=(0,Qn.useState)(1),g=t.reduce((f,u)=>f+Tv(u),0),m=r.reduce((f,u)=>f+Tv(u),0),b=dc(n)*F_+dc(l)*W_,y=Math.max(0,g-m-b),T=y*p/I_,D=(f,u,w,v)=>{f(S=>S.map((R,z)=>z===u?{...R,[w]:v}:R))};return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Paint Calculator"}),(0,$.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,$.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,$.jsx)("span",{}),(0,$.jsx)("span",{children:"Height (m)"}),(0,$.jsx)("span",{children:"Width (m)"}),(0,$.jsx)("span",{})]}),t.map((f,u)=>(0,$.jsxs)("div",{className:"paint-calculator__row",children:[(0,$.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,$.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:w=>D(a,u,"height",w.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,$.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:w=>D(a,u,"width",w.target.value)})]}),t.length>1?(0,$.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(w=>w.filter((v,S)=>S!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,$.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(f=>[...f,pc()]),children:"+ Add another wall"})]}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,$.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,$.jsx)("span",{}),(0,$.jsx)("span",{children:"Height (m)"}),(0,$.jsx)("span",{children:"Width (m)"}),(0,$.jsx)("span",{})]}),r.map((f,u)=>(0,$.jsxs)("div",{className:"paint-calculator__row",children:[(0,$.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,$.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:w=>D(i,u,"height",w.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,$.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:w=>D(i,u,"width",w.target.value)})]}),r.length>1?(0,$.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(w=>w.filter((v,S)=>S!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,$.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(f=>[...f,pc()]),children:"+ Add another area"})]}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Doors"}),(0,$.jsx)("input",{type:"number",min:"0",step:"1",value:n,onChange:f=>o(f.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Double doors"}),(0,$.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:f=>c(f.target.value)})]})]}),(0,$.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Number of coats"}),(0,$.jsxs)("select",{value:p,onChange:f=>d(Number(f.target.value)),children:[(0,$.jsx)("option",{value:"1",children:"1 coat"}),(0,$.jsx)("option",{value:"2",children:"2 coats"}),(0,$.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,$.jsxs)("div",{className:"paint-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,$.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Paintable area"}),(0,$.jsxs)("strong",{children:[y.toFixed(2)," m\xB2"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Coverage"}),(0,$.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Paint required"}),(0,$.jsxs)("strong",{children:[T.toFixed(1)," litres"]})]})]}),(0,$.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,$.jsxs)("div",{className:"paint-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var gr=Y(Ye()),te=Y(ee()),mc=e=>Number.parseFloat(e)||0,Qd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Gd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,gr.useState)("paving"),[n,o]=(0,gr.useState)("council"),[l,c]=(0,gr.useState)(""),[p,d]=(0,gr.useState)(""),[g,m]=(0,gr.useState)("100"),[b,y]=(0,gr.useState)("50"),[T,D]=(0,gr.useState)(!0),[f,u]=(0,gr.useState)(!0),w=mc(l)*mc(p),v=w,S=w*(mc(g)/1e3),R=w*.04,z=w*(mc(b)/1e3),A=Math.ceil(v/.36),Q=Math.ceil(v/.1),K=Math.ceil(S*1700/800),me=Math.ceil(R*1600/800),Ue=Math.ceil(z*1600/800),Be=r==="paving"?{qty:A,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Ue,unit:"bag"},Ge={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],ke=[{key:`surface-${n}`,label:Qd[r].find(re=>re.id===n)?.label??"Surface material",qty:Be.qty,unit:Be.unit,query:Ge,category:"landscaping"},...T?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:K,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:me,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Paving and Driveway Calculator"}),(0,te.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,te.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,te.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([re,ue,ve])=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===re?" is-selected":""}`,onClick:()=>{i(re),o(Qd[re][0].id)},children:[(0,te.jsx)("div",{className:"truss-estimator__option-title",children:ue}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:ve})]},re))}),(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Finish"}),(0,te.jsx)("select",{value:n,onChange:re=>o(re.target.value),children:Qd[r].map(re=>(0,te.jsx)("option",{value:re.id,children:re.label},re.id))})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,te.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Length (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:re=>c(re.target.value)})]}),(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Width (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:re=>d(re.target.value)})]})]}),r==="gravel"&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Gravel depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:re=>y(re.target.value)})]}),T&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Sub-base depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:g,onChange:re=>m(re.target.value)})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:T,onChange:re=>D(re.target.checked)}),(0,te.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:f,onChange:re=>u(re.target.checked)}),(0,te.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Surface area"}),(0,te.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,te.jsx)("strong",{children:r==="paving"?`${A} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Ue} bulk bags`})]}),T&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"MOT Type 1"}),(0,te.jsxs)("strong",{children:[K," bulk bags"]})]}),f&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Sharp sand"}),(0,te.jsxs)("strong",{children:[me," bulk bags"]})]})]}),(0,te.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,te.jsxs)("div",{className:"materials-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(ke),disabled:w<=0,children:a})]})]})]})})}var ll=Y(Ye()),ae=Y(ee()),ex=2.88,zv=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],Av=()=>({length:"",height:""}),Yd=e=>Number.parseFloat(e)||0;function Xd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ll.useState)([Av()]),[n,o]=(0,ll.useState)(""),[l,c]=(0,ll.useState)("standard"),[p,d]=(0,ll.useState)("screws"),g=r.reduce((R,z)=>R+Yd(z.length)*Yd(z.height),0),m=Math.max(0,g-Yd(n)),b=Math.ceil(m/ex),y=Math.ceil(m*12),T=Math.ceil(y/1e3),D=Math.ceil(m*1.2),f=Math.ceil(D/90),u=Math.ceil(m/3.5),w=zv.find(R=>R.id===l)?.label??"Standard",v=[{key:"board",label:`${w} plasterboard`,qty:b,unit:"sheet",query:`${w} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:T,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],S=(R,z,A)=>{i(Q=>Q.map((K,me)=>me===R?{...K,[z]:A}:K))};return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Plasterboard and Drylining Calculator"}),(0,ae.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:zv.map(R=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===R.id?" is-selected":""}`,onClick:()=>c(R.id),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:R.label}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:R.blurb})]},R.id))})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([R,z,A])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===R?" is-selected":""}`,onClick:()=>d(R),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:z}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:A})]},R))})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,ae.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,ae.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,ae.jsx)("span",{children:"Surface"}),(0,ae.jsx)("span",{children:"Length (m)"}),(0,ae.jsx)("span",{children:"Height (m)"}),(0,ae.jsx)("span",{})]}),r.map((R,z)=>(0,ae.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,ae.jsxs)("span",{children:["Surface ",z+1]}),(0,ae.jsx)("input",{"aria-label":`Surface ${z+1} length`,type:"number",min:"0",step:"0.01",value:R.length,onChange:A=>S(z,"length",A.target.value)}),(0,ae.jsx)("input",{"aria-label":`Surface ${z+1} height`,type:"number",min:"0",step:"0.01",value:R.height,onChange:A=>S(z,"height",A.target.value)}),r.length>1?(0,ae.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(A=>A.filter((Q,K)=>K!==z)),children:"Remove"}):null]},`surface-${z}`)),(0,ae.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(R=>[...R,Av()]),children:"+ Add another surface"}),(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,ae.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,ae.jsx)("small",{children:"optional"})]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:R=>o(R.target.value)})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Board area"}),(0,ae.jsxs)("strong",{children:[m.toFixed(2)," m\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,ae.jsx)("strong",{children:b})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,ae.jsx)("strong",{children:p==="screws"?`${y} (${T} boxes)`:`${u} bags`})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Joint tape"}),(0,ae.jsxs)("strong",{children:[D," m (",f," rolls)"]})]})]}),(0,ae.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,ae.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:m<=0,children:a})]})]})]})})}var sl=Y(Ye());var _=Y(ee()),Rt={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},fc=["range","pitchAndDimensions","quantityAndGirders","bracing"],tx={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function ax({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function rx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(d,g,m,b,y=8,T)=>{let D=m-d,f=b-g,u=Math.hypot(D,f)||1,w=-f/u,v=D/u,S=y*.2;return(0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:d,y1:g,x2:m,y2:b,stroke:a,strokeWidth:y+3,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:d,y1:g,x2:m,y2:b,stroke:t,strokeWidth:y,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:d-w*S,y1:g-v*S,x2:m-w*S,y2:b-v*S,stroke:r,strokeWidth:Math.max(1.5,y*.24),strokeLinecap:"round",opacity:"0.9"})]},T)},l=(d,g,m)=>(0,_.jsxs)("g",{children:[(0,_.jsx)("rect",{x:d-7.5,y:g-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,_.jsx)("circle",{cx:d-4,cy:g-2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d+4,cy:g-2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d-4,cy:g+2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d+4,cy:g+2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d,cy:g,r:"1",fill:n})]},m),c=(d,g)=>(0,_.jsx)("rect",{x:d-9,y:"110",width:"18",height:"10",fill:a},g),p=(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,_.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,_.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,_.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function ix({enabled:e}){return(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,_.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,_.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function Rv({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,_.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,_.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Vd({onBack:e}){let[t,a]=(0,sl.useState)(0),[r,i]=(0,sl.useState)(tx),[n,o]=(0,sl.useState)(!1),[l,c]=(0,sl.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},g=(()=>{let f=r.range?Rt.ranges[r.range]:Rt.ranges.standard,u=r.pitch??"22.5",w=Rt.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,R=(Number.parseFloat(r.overhangMM)||0)>Rt.overhang.thresholdMM,z=p(),A=z+r.girderCount,Q=Number.parseFloat(r.roofLengthM)||0,K=r.treatment?Rt.treatment[r.treatment]:Rt.treatment.untreated,me=Rt.estimate.ranges[r.range??"standard"],Ue=me.supplyAt8m*Math.max(.7,v/8)*w*(1+K.surchargePct)+(R?Rt.overhang.surchargePerTruss:0),Be=z*Ue,Ge=r.girderCount*Ue*Rt.estimate.girderMultiplier,ke=r.bracing==="yes"?Q*Rt.estimate.bracingPerMetre:0,we=Be+Ge+ke+Rt.estimate.delivery,re=Rt.estimate.design+z*me.installPerTruss+r.girderCount*40,ue=we+re,ve=ue*.2;return{range:f,count:z,girderCount:r.girderCount,overhangApplies:R,overhangUnits:A,roofLengthM:Q,treatment:K,trussSupply:Be,bracingMaterials:ke,delivery:Rt.estimate.delivery,labour:re,subtotal:ue,vat:ve,total:ue+ve}})(),m=()=>{let f=fc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===fc.length-1?"View truss request":"Next",y=()=>{n?o(!1):t===0?e():a(f=>f-1)},T=()=>{m()&&(t===fc.length-1?(c(!1),o(!0)):a(f=>f+1))},D=()=>{let f=fc[t];return f==="range"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(Rt.ranges).map(([u,w])=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(v=>({...v,range:u})),children:[(0,_.jsx)(rx,{type:u}),(0,_.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,_.jsx)("div",{className:"truss-estimator__option-title",children:w.label}),(0,_.jsx)("div",{className:"truss-estimator__option-copy",children:w.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,_.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Span (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(w=>({...w,spanMM:u.target.value}))})]}),(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Overhang (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(w=>({...w,overhangMM:u.target.value}))}),(0,_.jsxs)("small",{children:["Overhangs beyond ",Rt.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Rt.pitches.map(u=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(w=>({...w,pitch:u})),children:[(0,_.jsx)(ax,{degrees:Number.parseFloat(u)}),(0,_.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,_.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,_.jsx)("span",{children:"Roof length (m)"}),(0,_.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(w=>({...w,roofLengthM:u.target.value}))})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:Rt.centresOptions.map(u=>(0,_.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(w=>({...w,centres:u})),children:(0,_.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,_.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,_.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,_.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,_.jsx)("span",{children:r.girderCount}),(0,_.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(w=>({...w,bracing:u.id})),children:[(0,_.jsx)(ix,{enabled:u.id==="yes"}),(0,_.jsx)("span",{children:u.label})]},u.id))}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,_.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,_.jsx)(Rv,{treated:!1}),(0,_.jsx)("span",{children:"Untreated"})]}),(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,_.jsx)(Rv,{treated:!0}),(0,_.jsx)("span",{children:"Treated (+8% cost)"}),(0,_.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"truss-estimator",children:[(0,_.jsxs)("div",{className:"quick-order-hero",children:[(0,_.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,_.jsx)("h1",{children:"Your truss estimate"}),(0,_.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,_.jsxs)("div",{className:"truss-request__heading",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,_.jsxs)("h2",{children:[g.range.label," roof trusses"]})]}),(0,_.jsxs)("strong",{children:[g.count,(0,_.jsx)("span",{children:"trusses"})]})]}),(0,_.jsxs)("div",{className:"truss-request__grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Span"}),(0,_.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Roof length"}),(0,_.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Pitch"}),(0,_.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Centres"}),(0,_.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Overhang"}),(0,_.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Treatment"}),(0,_.jsx)("strong",{children:g.treatment.label})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Girder trusses"}),(0,_.jsx)("strong",{children:g.girderCount||"None"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing pack"}),(0,_.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,_.jsxs)("div",{className:"truss-request__price",children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,_.jsxs)("div",{className:"truss-request__price-grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Truss supply allowance"}),(0,_.jsx)("strong",{children:ot(g.trussSupply)})]}),g.bracingMaterials>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing materials allowance"}),(0,_.jsx)("strong",{children:ot(g.bracingMaterials)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Delivery allowance"}),(0,_.jsx)("strong",{children:ot(g.delivery)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Design and installation labour"}),(0,_.jsx)("strong",{children:ot(g.labour)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,_.jsx)("strong",{children:ot(g.subtotal)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"VAT (20%)"}),(0,_.jsx)("strong",{children:ot(g.vat)})]}),(0,_.jsxs)("div",{className:"truss-request__price-total",children:[(0,_.jsx)("span",{children:"Estimated total"}),(0,_.jsx)("strong",{children:ot(g.total)})]})]}),(0,_.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,_.jsxs)("div",{className:"truss-request__notice",children:[(0,_.jsx)("strong",{children:"Before ordering"}),(0,_.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back to calculator"}),(0,_.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,_.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"truss-estimator",children:[(0,_.jsxs)("div",{className:"quick-order-hero",children:[(0,_.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,_.jsx)("h1",{children:"Roof Truss Calculator"}),(0,_.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card",children:[(0,_.jsx)("div",{className:"truss-estimator__body",children:D()}),(0,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back"}),(0,_.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:T,disabled:!m(),children:[(0,_.jsx)("span",{children:b}),(0,_.jsx)("span",{className:"arrow",children:(0,_.jsx)(Qt,{})})]})]})]})]})})}var Si=Y(Ye()),F=Y(ee()),Ov=e=>Number.parseFloat(e)||0,hc=(e,t)=>Ov(e)*(t==="m"?1:.3048),Uv=()=>({length:"",width:""}),Dv=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function nx({profile:e}){return(0,F.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,F.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,F.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function $d({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Si.useState)("total"),[n,o]=(0,Si.useState)("m"),[l,c]=(0,Si.useState)(""),[p,d]=(0,Si.useState)([Uv()]),[g,m]=(0,Si.useState)(""),[b,y]=(0,Si.useState)("chamfered"),T="4.4",D=r==="total"?hc(l,n):p.reduce((S,R)=>S+2*(hc(R.length,n)+hc(R.width,n)),0),f=Math.max(0,D-hc(g,n)),u=Math.ceil(f/Ov(T)),w=[{key:`skirting-${b}`,label:`${Dv.find(S=>S.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],v=(S,R,z)=>{d(A=>A.map((Q,K)=>K===S?{...Q,[R]:z}:Q))};return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"truss-estimator",children:[(0,F.jsxs)("div",{className:"quick-order-hero",children:[(0,F.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,F.jsx)("h1",{children:"Skirting Board Calculator"}),(0,F.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,F.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,F.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,F.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,F.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,F.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,F.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,F.jsx)("span",{children:"Units"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,F.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,F.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:S=>c(S.target.value)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,F.jsx)("span",{children:"Room"}),(0,F.jsxs)("span",{children:["Length (",n,")"]}),(0,F.jsxs)("span",{children:["Width (",n,")"]}),(0,F.jsx)("span",{})]}),p.map((S,R)=>(0,F.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,F.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",R+1]}),(0,F.jsx)("input",{"aria-label":`Room ${R+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:S.length,onChange:z=>v(R,"length",z.target.value)}),(0,F.jsx)("input",{"aria-label":`Room ${R+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:S.width,onChange:z=>v(R,"width",z.target.value)}),p.length>1?(0,F.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>d(z=>z.filter((A,Q)=>Q!==R)),children:"Remove"}):null]},`room-${R}`)),(0,F.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(S=>[...S,Uv()]),children:"+ Add another room"})]}),(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,F.jsx)("small",{children:"optional"})]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:S=>m(S.target.value)})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.4m white-primed MDF boards."}),(0,F.jsx)("div",{className:"architrave-calculator__profiles",children:Dv.map(S=>(0,F.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===S.id?" is-selected":""}`,onClick:()=>y(S.id),children:[(0,F.jsx)(nx,{profile:S.id}),(0,F.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,F.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,F.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,F.jsxs)("label",{className:"truss-estimator__field",children:[(0,F.jsx)("span",{children:"Board length"}),(0,F.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,F.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,F.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Net skirting"}),(0,F.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Board lengths"}),(0,F.jsx)("strong",{children:u})]})]}),(0,F.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,F.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,F.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,F.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:f<=0,children:a})]})]})]})})}var Gn=Y(Ye()),ne=Y(ee()),cl=e=>Number.parseFloat(e)||0;function Zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Gn.useState)("studs"),[n,o]=(0,Gn.useState)(""),[l,c]=(0,Gn.useState)(""),[p,d]=(0,Gn.useState)("600"),[g,m]=(0,Gn.useState)("2.4"),b=n&&l&&p?Math.ceil(cl(l)/(cl(p)/1e3))+1:0,y=b*cl(n),T=cl(g)>0?Math.ceil(y/cl(g)):0,D=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:y,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},w={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)("div",{className:"truss-estimator",children:[(0,ne.jsxs)("div",{className:"quick-order-hero",children:[(0,ne.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ne.jsx)("h1",{children:"Timber Calculator"}),(0,ne.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,ne.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ne.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,ne.jsxs)("p",{className:"truss-estimator__step-sub",children:[w.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,ne.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(v=>(0,ne.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,ne.jsx)("div",{className:"truss-estimator__option-title",children:f[v][0]}),(0,ne.jsx)("div",{className:"truss-estimator__option-copy",children:f[v][1]})]},v))})]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[w.member," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[w.overall," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Centres (mm)"}),(0,ne.jsxs)("select",{value:p,onChange:v=>d(v.target.value),children:[(0,ne.jsx)("option",{value:"300",children:"300 mm"}),(0,ne.jsx)("option",{value:"400",children:"400 mm"}),(0,ne.jsx)("option",{value:"450",children:"450 mm"}),(0,ne.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Stock length (m)"}),(0,ne.jsxs)("select",{value:g,onChange:v=>m(v.target.value),children:[(0,ne.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,ne.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,ne.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ne.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:w.count}),(0,ne.jsx)("strong",{children:b})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Linear metres"}),(0,ne.jsxs)("strong",{children:[y.toFixed(2)," m"]})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsxs)("span",{children:[g," m lengths"]}),(0,ne.jsx)("strong",{children:T})]})]}),(0,ne.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,ne.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ne.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ne.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(D),disabled:y<=0,children:a})]})]})]})})}var Kd=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Vd},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Ld},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Bd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Td},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:jd},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:$d},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Md},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Dd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Xd},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:Hd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Zd},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Gd}];var bc=Y(Ye());var Qe=Y(Ye());var C=Y(ee()),ox=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Pd={wasteFactorEnabled:!0},lx=3e3,Bv=null;function gc(e,t){let a=el(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function sx(e){return e&&e.length>0?e.join(" x "):"-"}function Jd({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=tc(),o=`${e}~${t.map(k=>`${k.key}|${k.query}|${k.category??""}|${k.qty}`).join("~")}`,l=o!==Bv,[c,p]=(0,Qe.useState)(null),[d,g]=(0,Qe.useState)([]),[m,b]=(0,Qe.useState)(l),[y,T]=(0,Qe.useState)(null),[D,f]=(0,Qe.useState)("tile"),[u,w]=(0,Qe.useState)(null),[v,S]=(0,Qe.useState)(""),[R,z]=(0,Qe.useState)(null),[A,Q]=(0,Qe.useState)(""),[K,me]=(0,Qe.useState)([]),[Ue,Be]=(0,Qe.useState)(new Set),[Ge,ke]=(0,Qe.useState)(null),[we,re]=(0,Qe.useState)(""),[ue,ve]=(0,Qe.useState)([]),ut=(0,Qe.useRef)(null),G=(0,Qe.useRef)(!1),pe=k=>`${e}:${k}`,Te=k=>Kr(k.chosen,{lineId:pe(k.requirement.key),description:k.requirement.label,unit:k.requirement.unit,qty:k.requirement.qty}),vt=(0,Qe.useMemo)(()=>t.map(k=>`${k.key}|${k.query}|${k.category??""}`).join("~"),[t]);(0,Qe.useEffect)(()=>{let k=!1;return Nv().then(L=>{k||p(L.itemCount>0)}).catch(()=>{k||p(!1)}),()=>{k=!0}},[]),(0,Qe.useEffect)(()=>{if(!a||!c)return;let k=!1,L;l&&b(!0),T(null);let P=Date.now();return(async()=>{let ce=null;try{ce=(await kv(t,void 0,e)).map(({requirement:yt,candidates:rt})=>({requirement:yt,candidates:rt,chosen:rt[0]??null}))}catch(_e){k||T(_e instanceof Error?_e.message:"Could not load products")}if(!k){if(Bv=o,l){let _e=lx-(Date.now()-P);_e>0&&await new Promise(yt=>{L=window.setTimeout(yt,_e)})}k||(ce&&(g(ce),!G.current&&n&&(G.current=!0,n.addManyToCart(ce.filter(_e=>_e.chosen).map(Te)))),b(!1))}})(),()=>{k=!0,window.clearTimeout(L)}},[a,c,vt]),(0,Qe.useEffect)(()=>{if(!R)return;let k=A.trim();if(!k){me([]);return}let L=!1,P=window.setTimeout(()=>{fr(k).then(ce=>{L||me(ce)}).catch(()=>{L||me([])})},250);return()=>{L=!0,window.clearTimeout(P)}},[R,A]),(0,Qe.useEffect)(()=>{if(!Ge)return;let k=we.trim();if(!k){ve([]);return}let L=!1,P=window.setTimeout(()=>{fr(k).then(ce=>{L||ve(ce)}).catch(()=>{L||ve([])})},250);return()=>{L=!0,window.clearTimeout(P)}},[Ge,we]);let Ot=(0,Qe.useMemo)(()=>{let k=v.trim().toLowerCase(),L=k?d.filter(P=>P.requirement.label.toLowerCase().includes(k)||(P.chosen?.description??"").toLowerCase().includes(k)||(P.chosen?.product_id??"").toLowerCase().includes(k)):d;return u?[...L].sort((P,ce)=>{let _e=P.requirement.label.localeCompare(ce.requirement.label);return u==="asc"?_e:-_e}):L},[d,v,u]),Ut=Ot.filter(k=>k.chosen),Ze=Ot.filter(k=>!k.chosen),Ne=d.filter(k=>k.chosen),ye=Ne.filter(k=>k.chosen?.price==null).length,Ee=Ne.reduce((k,L)=>k+(Ft(Te(L),Pd).lineTotal??0),0);if((0,Qe.useEffect)(()=>{i?.(Ee)},[Ee,i]),!a||c===!1)return null;let M=n?Ne.filter(k=>n.cart[pe(k.requirement.key)]).length:0,O=Ge?d.find(k=>k.requirement.key===Ge)??null:null,se=we.trim()?ue:O?.candidates??[],he=k=>{let L=R===k.requirement.key;z(L?null:k.requirement.key),Q(L?"":k.requirement.query)},Ae=(k,L)=>{let P=d.find(ce=>ce.requirement.key===k);g(ce=>ce.map(_e=>_e.requirement.key===k?{..._e,chosen:L}:_e)),n&&P&&n.cart[pe(k)]&&n.addToCart(Te({...P,chosen:L})),z(null),Q("")},Ke=k=>{g(L=>L.map(P=>P.requirement.key===k?{...P,chosen:null}:P)),n?.cart[pe(k)]&&n.removeFromCart(pe(k))},h=k=>{ke(k.requirement.key),re(""),ve([])},E=()=>{ke(null),re(""),ve([])},N=k=>{if(!n)return;let L=pe(k.requirement.key);n.cart[L]?n.removeFromCart(L):n.addToCart(Te(k))},X=k=>{Be(L=>{let P=new Set(L);return P.has(k)?P.delete(k):P.add(k),P})},Z=k=>{let L=K.length>0?K:k.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:A,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:P=>Q(P.target.value),"aria-label":`Search a product for ${k.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[L.map(P=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${P.product_id===k.chosen?.product_id?" is-selected":""}`,onClick:()=>Ae(k.requirement.key,P),children:[(0,C.jsx)("span",{children:P.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${ot(P.price)}`]})]},P.product_id)),L.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!m&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!O&&(0,C.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[ye>0&&(0,C.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,C.jsx)("strong",{children:ye})," need pricing"]}),(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:k=>S(k.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="tile"?" is-active":""}`,"aria-pressed":D==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="list"?" is-active":""}`,"aria-pressed":D==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:ut,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:ox.map(k=>{let L=u===k.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{w(L?null:k.dir),ut.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),k.label]},k.dir)})})]})]})]})]}),O&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:E,children:[(0,C.jsx)(Zr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:we,onChange:k=>re(k.target.value),"aria-label":`Search a product for ${O.requirement.label}`})}),O.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ke(O.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(O.chosen?.description||O.requirement.label,O.chosen?.product_id,O.chosen?.pdp_photo_url),alt:""})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:O.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[vi(O.requirement.qty)," ",ka(O.requirement.unit,O.requirement.qty)]}),O.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:O.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[O.chosen.product_id,O.chosen.price!=null?` \xB7 ${gc(O.chosen.price,O.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[pe(O.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(O),disabled:!O.chosen||!n,children:n?.cart[pe(O.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),se.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:se.map(k=>{let L=k.product_id===O.chosen?.product_id;return(0,C.jsxs)("tr",{className:L?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:k.description}),(0,C.jsx)("div",{className:"results-row-meta",children:k.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:sx(k.measurements_mm)})}),(0,C.jsx)("td",{children:k.price!=null?gc(k.price,k.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:L?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:L,onChange:()=>{L?Ke(O.requirement.key):Ae(O.requirement.key,k)},"aria-label":L?`${k.description} selected`:`Use ${k.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},k.product_id)})})]})]}),!O&&m&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(dr,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!O&&y&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:y}),!O&&!m&&!y&&Ot.length===0&&d.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!O&&!m&&!y&&D==="tile"&&Ut.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:Ut.map(k=>{let{requirement:L,chosen:P}=k,ce=P?Ft(Te(k),Pd):null,_e=n?!!n.cart[pe(L.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>h(k),"aria-label":`Review match for ${L.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(P?.description||L.label,P?.product_id,P?.pdp_photo_url),alt:""})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[P?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:P.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:P.product_id}),P.price!=null?(0,C.jsx)("span",{children:gc(P.price,P.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:L.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[vi(L.qty)," ",ka(L.unit,L.qty)]}),ce?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",ce.requiredSellUnits," ",ce.sellUnit,ce.lineTotal!=null?` \xB7 ${ot(ce.lineTotal)}`:""]}):P?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>h(k),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(k),disabled:!P||!n,children:_e?"\u2713 Added":"+ Add"})]})]},L.key)})}),!O&&!m&&!y&&D==="list"&&Ut.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:Ut.map(k=>{let{requirement:L,chosen:P}=k,ce=P?Ft(Te(k),Pd):null,_e=n?!!n.cart[pe(L.key)]:!1,yt=Ue.has(L.key);return(0,C.jsxs)(Qe.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>X(L.key),"aria-expanded":yt,"aria-label":yt?"Collapse product options":"Expand product options",children:yt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:L.label}),ce?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",ce.requiredSellUnits," ",ce.sellUnit,ce.lineTotal!=null?` \xB7 ${ot(ce.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:vi(L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:ka(L.unit,L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:P?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:P.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${gc(P.price,P.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(k),disabled:!P||!n,children:_e?"\u2713 Added":"+ Add"})})]}),yt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:R===L.key?Z(k):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[k.candidates.map(rt=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${rt.product_id===P?.product_id?" is-selected":""}`,onClick:()=>Ae(L.key,rt),children:[(0,C.jsx)("span",{children:rt.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[rt.product_id,rt.price!=null&&` \xB7 ${ot(rt.price)}`]})]},rt.product_id)),k.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>he(k),children:"Search the catalogue"})]})})})]},L.key)})})]})}),!O&&!m&&!y&&Ze.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:Ze.map(k=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>h(k),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:k.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[vi(k.requirement.qty)," ",ka(k.requirement.unit,k.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},k.requirement.key))})]}),!m&&!y&&d.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!O&&!m&&!y&&(r||M>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),M>0&&n&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",M,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=Y(ee());function Id({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,bc.useState)(0),o=(0,bc.useCallback)(l=>n(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:ot(i)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(Jd,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var Fd=Y(Ye());var Wt=Y(ee()),cx=1500;function Lv(e){let{addManyToCart:t,clearCart:a,openBasket:r}=Un(),[i,n]=(0,Fd.useState)(!1),[o,l]=(0,Fd.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,d)=>{let g=Date.now();n(!0),l(null);try{let m=await Promise.all(p.filter(y=>y.qty>0).map(async y=>{let T=(await fr(y.search)).find(D=>D.product_id===y.productId);if(!T)throw new Error("A selected product is no longer available in this catalogue.");return Kr(T,{lineId:`${e}:${y.key}`,description:T.description,unit:Ad(y.unit??"each",T),qty:y.qty,calculatorWasteIncluded:d})})),b=cx-(Date.now()-g);b>0&&await new Promise(y=>window.setTimeout(y,b)),a(),t(m),r()}catch(m){l(m instanceof Error?m.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function Hv({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(dr,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Re=Y(ee());function wc(e){let[t,a]=(0,Xa.useState)(!1);return(0,Re.jsx)(ec,{onOpenBasket:()=>a(!0),children:(0,Re.jsx)(ux,{...e,showBasket:t,onShowBasket:a})})}function ux({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,Xa.useState)(null),[l,c]=(0,Xa.useState)(null),p=Kd.find(A=>A.id===n),{cart:d,updateCartQty:g,updateCartSellUnits:m,updateCartConversions:b,removeFromCart:y,clearCart:T}=Un(),{adding:D,basketError:f,addToBasket:u}=Lv(p?.title??"calculator"),w=(0,Xa.useRef)(null),v=Ys("estimating-tools",w);(0,Xa.useEffect)(()=>{v("viewed")},[v]);let S=r?"basket":D?"adding":l?"review":n??"list",R=(0,Xa.useRef)(S);(0,Xa.useEffect)(()=>{R.current!==S&&(R.current=S,window.scrollTo(0,0))},[S]);let z=A=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:A.length});let Q=_v(p.id,A);Q?u(Q,A[0]?.calculatorWasteIncluded??!1):c(A)};return(0,Re.jsx)(Po.Provider,{value:v,children:(0,Re.jsx)("div",{ref:w,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:jt().theme,children:(0,Re.jsx)("main",{className:"main-content",children:r?(0,Re.jsx)(ol,{cart:d,onUpdateQty:g,onUpdateSellUnits:m,onResolveConversions:b,onRemove:y,onBack:()=>i(!1),onStartNewQuote:()=>{T(),o(null),c(null),i(!1)},internal:a}):D&&p?(0,Re.jsx)(Hv,{toolTitle:p.title}):p?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)("div",{hidden:l!==null,children:(0,Re.jsx)(p.Component,{onBack:()=>o(null),onReview:z})}),f&&(0,Re.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,Re.jsx)(Id,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsxs)("div",{className:"quick-order-card",children:[(0,Re.jsxs)("div",{className:"quick-order-hero",children:[(0,Re.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Re.jsx)("h1",{children:"Estimating Tools"}),(0,Re.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Re.jsxs)("div",{className:"quick-order-alt",children:[(0,Re.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Re.jsx)("div",{className:"estimator-tools-grid",children:Kd.map(A=>(0,Re.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:A.id}),o(A.id),c(null)},children:[(0,Re.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Re.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(A.imageUrl),alt:""})}),(0,Re.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Re.jsx)("span",{className:"estimator-tool-card__title",children:A.title}),(0,Re.jsx)("span",{className:"estimator-tool-card__desc",children:A.desc})]})]},A.id))})]})]})})})})})}var vc=Y(ee());function Wd({config:e,children:t}){return rw(e),(0,vc.jsx)(vc.Fragment,{children:t})}var em=Y(ee()),px="https://api.metronlabs.ai",dx=["client","api-key","api-url","theme","hide-header","analytics"],mx=["all","events-only","none"];function Qv(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.57",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
6993
+ `)}function Kr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var hv=e=>(e??"").trim().toLowerCase(),g_={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Cd=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),pv=new Set(["box","bag","pack","pallet","roll","set","tub"]),dv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,mv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,yi=e=>{let t=hv(e);return g_[t]??t},lt=(e,t)=>{let a=yi(e),r=yi(t);return a.length>0&&a===r},b_=(e,t)=>{let a=hv(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},w_=e=>(e??"").split(",").map(t=>yi(t)).filter(Boolean),v_=(e,t)=>{let a=w_(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||lt(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||lt(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||lt(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},fv=(e,t)=>lt(t,"pallet")?e.itemsPerPallet??null:lt(t,"pack")?e.itemsPerPack??null:lt(t,"box")?e.itemsPerBox??null:null,y_=(e,t,a)=>{if(!lt(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!lt(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function tc(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,i)=>r+(i??0),0)}function Ft(e,t){let a=e.qty,r=yi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=yi(e.unit)||(a>0&&Cd.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?Cd.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=v=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${r}.`:v,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return p("Quantity needs confirmation.");if(!v_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let d=null,g="review",m=e.roundingRule,b=`Quantity review required, initial request needed ${a} ${i}.`,y=1+o,T=y_(e,i,r),D=e.unitConversions?.find(v=>lt(v.requestUom,i));if(!!e.saleUnit&&(lt(i,r)||!!D||lt(i,"each")&&!pv.has(r)))if(lt(i,r))d=a*y/n,g="direct",b=`${a} ${i}${o>0?` x ${y}`:""}`;else if(D){d=a*y/D.quantityPerSaleUnit,g="derived";let v=1/D.quantityPerSaleUnit,S=Math.round(v);b=lt(r,"each")&&D.quantityPerSaleUnit<1&&Math.abs(v-S)<1e-9?`${a} ${i}${o>0?` x ${y}`:""} x ${S} per ${i}`:`${a} ${i}${o>0?` x ${y}`:""} / ${D.quantityPerSaleUnit} ${i} per ${r}`}else lt(i,"each")&&!pv.has(r)&&(d=a*y/n,g="derived",b=`${a} ${r}${o>0?` x ${y}`:""}`);else if(lt(i,r)&&n>0)d=a*y/n,g="direct",b=o>0?`${a} ${i} x ${y} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(lt(i,"each")&&n>0&&Cd.has(r))d=a*y/n,g="derived",b=o>0?`${a} each x ${y} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(fv(e,i)!=null&&n>0){let v=fv(e,i)??0;d=a*v*y/n,g="derived";let S=`${a} ${i} x ${v} each${o>0?` x ${y}`:""}`;b=n===1&&lt(r,"each")?S:`${S} / ${n} each per ${r}`}else if(T!=null)d=a*y/T,g="derived",m??(m="round_up_each"),b=`${a} m2 x ${y} / ${T} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(d=a*y/n,g="derived",b=`${a} ${i}${o>0?` x ${y}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;lt(i,"m2")&&v!=null&&v>0&&(d=a*y/v,g="derived",b=`${a} m2 x ${y} / ${v} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;lt(i,"m2")&&v!=null&&v>0?(d=a/v,g="derived",b=`${a} m2 / ${v} m2 per sell unit`):lt(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(d=a*e.itemsPerM2*y/n,g="derived",b=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${y} / ${n}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;lt(i,"m")&&v!=null&&v>0&&(d=a*y/v,g="derived",b=`${a} m x ${y} / ${v} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let v=dv(a,i),S=dv(e.coverageQty??0,yi(e.coverageUom));v!=null&&S!=null&&S>0&&(d=v*y/S,g="derived",b=`${a} ${i} x ${y} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"){let v=mv(a,i),S=mv(e.coverageQty??0,yi(e.coverageUom));v!=null&&S!=null&&S>0&&(d=v*y/S,g="derived",b=`${a} ${i} x ${y} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;lt(i,"m3")&&v!=null&&v>0&&(d=a/v,g="derived",b=`${a} m3 / ${v} m3 per ${r}`)}}if(d==null||!Number.isFinite(d)||d<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let u=b_(d,m),w=l?c:u;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:u,requiredSellUnits:w,unitPrice:e.price,lineTotal:e.price!=null&&w!=null?e.price*w:null,calculation:l?`${b} = ${u} ${r} (manually set to ${w})`:`${b} = ${w} ${r}`,costingMode:g}}var gv=()=>import("./xlsx-K4MOA2QM.js"),rl=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],__=rl.indexOf("Line total");function x_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function bv(e){let t=await gv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[rl],n=0;for(let c of e){let{item:p,best:d,qty:g,band:m,unmatchable:b,decision:y}=c,T=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),D=!b&&d?.price!=null?d.price*g:null;D!=null&&(n+=D),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",T,g,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),y?.technical_classification??"",y?.include_in_quote==null?"":y.include_in_quote?"yes":"no",y?.approval_required==null?"":y.approval_required?"yes":"no",y?.approval_type??"",y?.missing_information.join(", ")??"",y?.confidence??"",y?.reason??"",b?"-":d?.product_id??y?.selected_candidate_id??"-",b?"-":d?.description??"-",b?"-":d?.price_basis??"-",b?null:d?.price??null,D,b?"-":m,x_(c)])}i.push(Array(rl.length).fill(null));let o=Array(rl.length).fill(null);o[0]="Estimated total",o[__]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(rl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var al=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function wv(e,t){let a=await gv(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],al]:[al],o=0;for(let p of e){let d=Ft(p),g=d.lineTotal;g!=null&&(o+=g),n.push([p.productId,p.description,d.costingMode,d.requestedAmount,xa(d.requestedUnit),d.salesUnitSize,xa(d.sellUnit),d.requiredSellUnits,d.unitPrice,g])}n.push(Array(al.length).fill(null));let l=Array(al.length).fill(null);l[0]="Estimated total",l[al.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var s=Y(ee()),Ed="__none__",il=24,k_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function xv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var N_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function S_(e,t){if(t!==Ed){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function vv(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function C_(e){return e?e.replace(/_/g," "):"not stated"}function q_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function An(e,t){if(e==null)return"-";let a=tl(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Md(e){return e&&e.length>0?e.join(" x "):"-"}function E_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function zn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Pr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function M_(e,t){return t>0||e==null?null:ot(e)}var yv=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function T_(e){let t=new Map;return[...new Set(e.filter(mr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:yv[i%yv.length]})}),t}function mr(e){return!1}function Rn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function qd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function z_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,6),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let i=new Map(e.map(o=>[o.product_id,o])),n=r.map(o=>i.get(o)).filter(o=>o!=null);if(a&&!n.some(o=>o.product_id===a)){let o=i.get(a);o&&n.unshift(o)}return[...new Map(n.map(o=>[o.product_id,o])).values()].slice(0,6)}function ac(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function rc(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function A_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:rc(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:rc(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:rc(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:rc(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function R_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:Md(r.measurements_mm)}),(0,s.jsx)("td",{children:tl(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function _v({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",zn(e.procurement_aliases)],["Retrieval queries",zn(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",Md(e.attrs.measurements_mm)],["Stock length",E_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",zn(e.installation_clues)],["System clues",zn(e.system_clues)],["Component requirements",zn(e.component_requirements)],["Linked group",Rn(e)||"-"],["Flags",zn(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function U_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function D_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function O_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:i=!1,linkedGroupMeta:n}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"No automatic match:":`AI review (${t.confidence??"confidence not stated"}):`;return i?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Rn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(_v,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_v,{item:e,result:a}),r&&(0,s.jsx)(U_,{item:e}),r&&(0,s.jsx)(D_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),mr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Rn(e)]}):null]}),r&&(0,s.jsx)(R_,{queries:a?.retrieval_debug??[]})]})}function B_({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:d=!1,debugEnabled:g=!1,forceReviewNote:m=!1,linkedGroupMeta:b}){let y=d||o==="detailed",T=g&&o==="detailed",D=y||m?(0,s.jsx)(O_,{item:e,decision:r,result:a,showRetrievalDebug:T,reviewOnly:m&&!y,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||d||o==="detailed"?t:z_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),T&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,w)=>{let v=u.product_id===n;return(0,s.jsxs)("tr",{className:v?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:Md(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:An(u.price,u.price_basis)}),T&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(q_,{band:xv(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${w}`)})})]})]})}function Td({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:d=!1}){let g=!d&&Vs()==="QZA6-MRA4",m=g?"quote":"basket",{results:b,lineItems:y,parseReport:T,timings:D}=e,[f,u]=(0,xe.useState)({}),w=Sn(),[v,S]=(0,xe.useState)({}),[R,z]=(0,xe.useState)({}),[A,Q]=(0,xe.useState)(""),[K,me]=(0,xe.useState)(null),[Re,Oe]=(0,xe.useState)(1),Qe=jt().debug===!0,[ke,we]=(0,xe.useState)("simple"),[re,ue]=(0,xe.useState)(d?"list":"tile"),[ye,ut]=(0,xe.useState)(!1),[G,pe]=(0,xe.useState)(null),[Me,St]=(0,xe.useState)(""),[Ot,Ut]=(0,xe.useState)([]),[Ze,Ne]=(0,xe.useState)(!1),[ve,Ve]=(0,xe.useState)(null),[M,B]=(0,xe.useState)(!1),[ie,se]=(0,xe.useState)(null),he=(0,xe.useRef)(null),[ze,Ke]=(0,xe.useState)(new Set),[h,E]=(0,xe.useState)(new Set),[N,X]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{Oe(1)},[A,K,re]);let Z=new Map(b.map(x=>[x.line_id,x])),k=T_(y),L=y.map(x=>{let H=Z.get(x.line_id),ge=H?.decision,pt=N_(x),Pe=f[x.line_id],ea=S_(H,Pe),Ti=a[x.line_id],i0=Pe===Ed?void 0:v[x.line_id]??(Ti&&Ti.productId!==ea?.product_id?vv(Ti):ea),gm=pt?void 0:i0,n0=x.qty??0;return{item:x,result:H,decision:ge,unmatchable:pt,best:gm,qty:n0,band:xv(gm?.scores?.overall)}}),ce=L.some(x=>!x.unmatchable&&!x.best&&!h.has(x.item.line_id))?null:tc(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),_e=0;for(let x of L){if(x.unmatchable||x.decision?.include_in_quote!==!0||!x.best)continue;let H=a[x.item.line_id];(!H||Ft(H).lineTotal==null)&&(_e+=1)}_e>0&&(ce=null);let vt=M_(ce,_e),rt=x=>!x.unmatchable&&!x.best&&x.decision?.technical_classification!=="no_suitable_candidate"&&ac(x.result).length>0,Ct=x=>x.best??ac(x.result)[0],Jr=L.filter(x=>!x.unmatchable&&!x.best).filter(x=>!h.has(x.item.line_id)),Nc=L.filter(x=>h.has(x.item.line_id)),Yt=L;if(A.trim()){let x=A.trim().toLowerCase();Yt=Yt.filter(H=>H.item.description_original?.toLowerCase().includes(x)||Ct(H)?.description?.toLowerCase().includes(x))}if(K){let x=K==="asc"?1:-1;Yt=[...Yt].sort((H,ge)=>x*(H.item.description_original||"").localeCompare(ge.item.description_original||""))}let br=Math.max(1,Math.ceil(Yt.length/il)),yt=Math.min(Re,br),Ci=Yt.slice((yt-1)*il,yt*il),sm=Ci.filter(x=>!x.unmatchable&&x.best),qx=Ci.filter(x=>rt(x)),Sc=Ci.filter(x=>!x.unmatchable&&(x.best||rt(x))),cm=Ci.filter(x=>x.unmatchable||!x.best&&!rt(x)),J=G?L.find(x=>x.item.line_id===G)??null:null,Iv=!d&&!c&&!J&&Jr.length>0,Xn=(0,xe.useRef)(null),Vn=()=>{let x=he.current;if(!x)return;let{top:H,left:ge,width:pt,height:Pe}=x.getBoundingClientRect(),Ti=x.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;se({top:H,left:ge,width:Ti?Ti-ge:pt,height:Pe})};(0,xe.useEffect)(()=>(window.addEventListener("scroll",Vn,!0),window.addEventListener("resize",Vn),()=>{window.removeEventListener("scroll",Vn,!0),window.removeEventListener("resize",Vn)})),(0,xe.useEffect)(()=>{let x=H=>{Xn.current&&!H.composedPath().includes(Xn.current)&&Xn.current.removeAttribute("open")};return document.addEventListener("click",x),()=>document.removeEventListener("click",x)},[]);let qi=x=>{pe(x),St("")},Fv=()=>{if(!G)return;let x=a[G];if(x){u(H=>({...H,[G]:x.productId})),S(H=>({...H,[G]:vv(x)}));return}u(H=>{let ge={...H};return delete ge[G],ge}),S(H=>{let ge={...H};return delete ge[G],ge})},Va=(x=!1)=>{let H=G?a[G]:void 0;!x&&H&&J?.best&&H.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(x||Fv(),pe(null),X(!1))};Wo(M,()=>B(!1)),Wo(!!J&&!M,()=>Va());let Wv=x=>{if(Ke(H=>new Set(H).add(x)),Jr.some(H=>H.item.line_id!==x)){Va(!0);return}p(),Va(!0)},e0=x=>{if(Cc(x),E(H=>new Set(H).add(x)),Jr.some(H=>H.item.line_id!==x)){Va(!0);return}p(),Va(!0)},t0=()=>{E(x=>new Set([...x,...Jr.map(H=>H.item.line_id)])),p()},um=()=>{J?.best&&(dm(J.item.line_id,J.best),r(Ei(J)),N?Wv(J.item.line_id):Va(!0))},pm=cm.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:cm.map(x=>{let{item:H,qty:ge}=x;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>qi(H.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Pr(H,y)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},H.line_id)})})]}):null,Cc=x=>{u(H=>({...H,[x]:Ed})),S(H=>({...H,[x]:void 0})),z(H=>({...H,[x]:void 0})),i(x)},qc=(x,H)=>{u(ge=>({...ge,[x]:H.product_id})),S(ge=>({...ge,[x]:H}))},dm=(x,H)=>{H.method==="catalogue_search"&&z(ge=>({...ge,[x]:H}))};function Ex(){w("downloaded",{type:"schedule",lines:L.length}),bv(L.map(({item:x,best:H,qty:ge,band:pt,unmatchable:Pe,decision:ea})=>({item:x,best:H,qty:ge,band:pt,unmatchable:Pe,decision:ea})))}function Ei(x){let H=x.best??ac(x.result)[0];return Kr(H,{lineId:x.item.line_id,description:x.item.description_original,unit:x.item.unit,qty:x.qty,linkedContext:x.item.linked_group_role==="dependent"&&x.item.linked_group_id?y.filter(ge=>ge.linked_group_id===x.item.linked_group_id&&ge.linked_group_role==="anchor").slice(0,1).map(ge=>{let pt=a[ge.line_id];return{line_id:ge.line_id,product_id:pt?.productId??null,measurements_mm:pt?.measurementsMm??ge.attrs.measurements_mm,description:pt?.description??ge.description_original,qty:ge.qty,unit:ge.unit,role:"anchor"}}):void 0})}(0,xe.useEffect)(()=>{if(!o){for(let x of L)!x.unmatchable&&x.best&&r(Ei(x));l()}},[o]),(0,xe.useEffect)(()=>{for(let x of L)!a[x.item.line_id]&&!x.unmatchable&&x.best&&r(Ei(x))},[e]),(0,xe.useEffect)(()=>{if(!G){Ut([]),Ve(null),Ne(!1);return}let x=Me.trim();if(!x){Ut([]),Ve(null),Ne(!1);return}let H=!1,ge=window.setTimeout(async()=>{try{Ne(!0),Ve(null);let pt=await fetch(za(`/api/catalogue/search?q=${encodeURIComponent(x)}`),{headers:bi()}),Pe=await Qa(pt);if(!pt.ok)throw new Error(Pe?.error||Pe?.message||"Failed to search catalogue");H||Ut(Array.isArray(Pe?.items)?Pe.items:[])}catch(pt){H||(Ut([]),Ve(pt?.message||"Failed to search catalogue"))}finally{H||Ne(!1)}},250);return()=>{H=!0,window.clearTimeout(ge)}},[Me,G]);let Ec=Object.keys(a).length,qa=Me.trim(),Mc=ac(J?.result),pl=J?.decision?.technical_classification==="no_suitable_candidate"||!!J&&!J.best,mm=J?.decision?.technical_classification!=null,fm=J?.decision?.reason??(pl?"No catalogue candidate found. Refine the request or search the catalogue.":null),a0=Ot.map(x=>({product_id:x.product_id,description:x.description,source_list:x.source_list,price:x.price,price_basis:x.price_basis,uoi_count:x.uoi_count??null,uoi:x.uoi,pdp_photo_url:x.pdp_photo_url??null,conversion:x.conversion,measurements_mm:x.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),$n=qa?a0:Mc,Mi=J?R[J.item.line_id]:void 0,Zn=!qa&&Mi&&!$n.some(x=>x.product_id===Mi.product_id)?[...$n,Mi]:$n,hm=(()=>{let x=Zn.slice(0,qa?12:6);return qa||!Mi||x.some(H=>H.product_id===Mi.product_id)?x:[...x,Mi]})(),dl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,r0=!!J?.best&&!!a[J.item.line_id]&&!dl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${d?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${d?"":" quick-order-hero--customer"}`,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:vt??"Review quantities"})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",g?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,disabled:Ec===0,"aria-label":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:g?"View Quote":"View Basket"}),vt!=null&&(0,s.jsx)("strong",{children:vt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Qe&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ye,onClick:()=>ut(x=>!x),children:ye?"Hide timings":"Show timings"})}),Qe&&ye&&(0,s.jsx)(A_,{...D}),!g&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[_e>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:_e})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:A,onChange:x=>Q(x.target.value),"aria-label":"Search line items"}),!d&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${re==="tile"?" is-active":""}`,"aria-pressed":re==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ue("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${re==="list"?" is-active":""}`,"aria-pressed":re==="list","aria-label":"List view",title:"List view",onClick:()=>ue("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Qe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(x=>x==="simple"?"detailed":"simple"),children:ke==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Xn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:k_.map(x=>{let H=K===x.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${H?" is-active":""}`,onClick:()=>{me(H?null:x.dir),Xn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:H?"\u2713":""}),x.label]},x.dir)})})]})]})]})}),re==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Va(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:x=>x.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Va(),"aria-label":"Close product options",children:(0,s.jsx)(Io,{})}),(0,s.jsx)("div",{className:"results-review-page",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Va(),children:[(0,s.jsx)(Zr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Qe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(x=>x==="simple"?"detailed":"simple"),children:ke==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:Me,onChange:x=>St(x.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Cc(J.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(Ct(J)?.description||J.item.description_original,Ct(J)?.product_id,Ct(J)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Pr(J.item,y)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[vi(J.qty)," ",ka(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:An(J.best.price,J.best.price_basis)}):null]}):Ct(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ct(J)?.description}),Ct(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:An(Ct(J)?.price??null,Ct(J)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),mr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(qd,{meta:k.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Rn(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?i(J.item.line_id):(J.best&&dm(J.item.line_id,J.best),r(Ei(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[J.item.line_id]?"\u2713 Added":d?"+ Add to selection":`Add to ${m}`})})]})]}),Ze?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!Ze&&ve?(0,s.jsx)("div",{className:"results-empty-card",children:ve}):null,!Ze&&!ve&&qa&&$n.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!Ze&&!ve?(0,s.jsx)(B_,{item:J.item,candidates:$n,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:ke,linkedGroupMeta:mr(J.item)?k.get(J.item.linked_group_id):void 0,onPick:x=>qc(J.item.line_id,x),onClear:()=>Cc(J.item.line_id),showAll:d||Qe||qa.length>0,internal:d,debugEnabled:Qe,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Pr(J.item,y)||"Original request"})]}),fm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:pl?"No automatic match:":"AI review:"})," ",fm]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:pl?Mc.length>0?"Choose a product":"No suitable product found":mm?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:pl?Mc.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":mm?`Select the option you want to add to your ${m}.`:"Search the catalogue to choose a product."})]})}),!qa&&Zn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:hm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>qc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${An(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null,Zn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:Me,onChange:x=>St(x.target.value),"aria-label":"Search catalogue"})]}),qa&&Ze?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,qa&&!Ze&&ve?(0,s.jsx)("div",{className:"results-empty-card",children:ve}):null,qa&&!Ze&&!ve&&Zn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,qa&&!Ze&&!ve&&Zn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:hm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>qc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${An(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null]}),J.best?r0?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{um()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${m}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${dl?" cta-btn-secondary":""}`,onClick:()=>{dl?i(J.item.line_id):um()},children:(0,s.jsx)("span",{children:dl?`Remove from ${m}`:`Add selected product to ${m}`})}):null,N?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>e0(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Sc.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Sc.map(x=>{let{item:H,best:ge,qty:pt}=x,Pe=Ct(x),ea=!ge&&rt(x);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>qi(H.line_id),"aria-label":`Review match for ${Pr(H,y)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[ea||mr(H)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[mr(H)?(0,s.jsx)(qd,{meta:k.get(H.linked_group_id)}):(0,s.jsx)("span",{}),ea?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(Pe?.description||H.description_original,Pe?.product_id,Pe?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Pe?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Pe.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Pe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:ea?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Pr(H,y)}),mr(H)?(0,s.jsx)("div",{className:"results-row-meta",children:Rn(H)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[d&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qi(H.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[H.line_id]?i(H.line_id):r(Ei(x))},disabled:!Pe,"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})]})]},H.line_id)})})}):null,pm]})]}):(0,s.jsxs)(s.Fragment,{children:[ie&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ie,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),ke==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),ke==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:d?"Selection":g?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:ke==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Sc.map(x=>{let{item:H,result:ge,decision:pt,best:Pe}=x;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>qi(H.line_id),onMouseEnter:ea=>{he.current=ea.currentTarget,Vn()},onMouseLeave:()=>{he.current=null,se(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Pr(H,y)}),mr(H)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(qd,{meta:k.get(H.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Rn(H)})]}):null]}),(0,s.jsx)("td",{children:Pe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Pe.description,children:Pe.description}),ke==="detailed"&&pt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[C_(pt.technical_classification),pt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Pe?.price!=null?An(Pe.price,Pe.price_basis):"-"}),ke==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:ea=>{ea.stopPropagation(),a[H.line_id]?i(H.line_id):r(Ei(x))},"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})})]},H.line_id)})]})]})}),pm]}),!J&&br>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(yt-1)*il+1,"\u2013",Math.min(yt*il,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Oe(yt-1),disabled:yt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",yt," of ",br]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Oe(yt+1),disabled:yt===br,children:"Next"})]})]}),(T.itemCount!=null||T.headingCount!=null||T.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[T.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.itemCount})," items parsed"]}),T.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.headingCount})," headings"]}),T.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:T.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>B(!0),"aria-label":"Start over",children:[(0,s.jsx)(Nd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,disabled:Ec===0,"aria-label":d?"View selection":g?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[d?"View Selection":g?"View Quote":"View Basket"," (",Ec,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),Iv&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:Jr.map(x=>{let H=ze.has(x.item.line_id),ge=rt(x);return(0,s.jsx)("div",{className:`review-gate-item${H?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{X(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Pr(x.item,y)}),(0,s.jsx)("span",{children:x.decision?.reason||(ge?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:H?"Choice made":"Choose a product"})]})},x.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:t0,children:"Skip all"}),Nc.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),Nc.map(x=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{E(H=>{let ge=new Set(H);return ge.delete(x.item.line_id),ge}),X(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Pr(x.item,y)}),(0,s.jsx)("span",{children:`Not added to your ${m}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},x.item.line_id))]}):null]})}),M&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",g?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>B(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{B(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var gt=Y(Ge());var At=Y(Ge()),kv=Y(ee());function Un(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function L_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var zd=(0,At.createContext)(null);function ic({children:e,onOpenBasket:t}){let[a,r]=(0,At.useState)({}),i=(0,At.useCallback)(m=>{r(b=>L_(b,m))},[]),n=(0,At.useCallback)(m=>{r(b=>{let y={...b};for(let T of m)y[T.lineId]=T;return y})},[]),o=(0,At.useCallback)(m=>{r(b=>{let y={...b};return delete y[m],y})},[]),l=(0,At.useCallback)((m,b)=>{r(y=>y[m]?{...y,[m]:{...y[m],qty:b,sellUnitsOverride:null}}:y)},[]),c=(0,At.useCallback)((m,b)=>{r(y=>y[m]?{...y,[m]:{...y[m],sellUnitsOverride:b}}:y)},[]),p=(0,At.useCallback)(m=>{r(b=>{let y=!1,T={...b};for(let[D,f]of Object.entries(m))T[D]&&(T[D]={...T[D],...f},y=!0);return y?T:b})},[]),d=(0,At.useCallback)(()=>r({}),[]),g=(0,At.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:d,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,d,t]);return(0,kv.jsx)(zd.Provider,{value:g,children:e})}function Dn(){let e=(0,At.useContext)(zd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function nc(){return(0,At.useContext)(zd)}var q=Y(ee()),Nv=.2,nl=10,Sv="Enter a valid email address so we can send your quote.",H_=(e,t)=>{let a=`${t.requestedAmount} ${xa(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${xa(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${xa(t.sellUnit,2)} per ${xa(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},j_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${xa(e.sellUnit,1)}.`;function Q_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function ol(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ll({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,gt.useId)(),d=!c&&Vs()==="QZA6-MRA4",g=Object.values(e),[m,b]=(0,gt.useState)(""),[y,T]=(0,gt.useState)(!1),[D,f]=(0,gt.useState)(!1),u=Sn(),[w,v]=(0,gt.useState)(""),[S,R]=(0,gt.useState)({}),[z,A]=(0,gt.useState)({}),[Q,K]=(0,gt.useState)(1),[me,Re]=(0,gt.useState)({}),[Oe,Qe]=(0,gt.useState)(!1),[ke,we]=(0,gt.useState)("0"),[re,ue]=(0,gt.useState)({}),ye=(0,gt.useRef)(new Map);(0,gt.useEffect)(()=>{if(!r)return;for(let N of Object.values(e))Ft(N).requiredSellUnits!=null&&ye.current.delete(N.lineId);let h=Object.values(e).filter(N=>{if(N.productId==="-"||Ft(N).requiredSellUnits!=null)return!1;let X=Un(N);return ye.current.get(N.lineId)===X?!1:(ye.current.set(N.lineId,X),!0)});if(h.length===0)return;let E=new Map(h.map(N=>[N.lineId,Un(N)]));ue(N=>({...N,...Object.fromEntries(E)})),fetch(za("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Cn()},body:JSON.stringify({lines:h.map(N=>({line_id:N.lineId,product_id:N.productId,requested_description:N.requestedDescription??N.description,requested_qty:N.qty,requested_uom:N.unit||null,linked_context:N.linkedContext??[],selected_description:N.description,selected_uoi:N.uoi,selected_uoi_count:N.uoiCount,selected_conversion:{sales_uom_normalised:N.salesUomNormalised,conversion_type:N.conversionType,sales_unit_size:N.salesUnitSize,sales_unit_size_uom:N.salesUnitSizeUom,coverage_qty:N.coverageQty,coverage_uom:N.coverageUom}}))})}).then(N=>N.ok?Qa(N):null).then(N=>{let X={},Z=new Map(h.map(k=>[k.lineId,Un(k)]));for(let k of N?.data?.items??N?.items??[]){let L=k?.conversion;if(!L||typeof k?.line_id!="string"||ye.current.get(k.line_id)!==Z.get(k.line_id))continue;let P=e[k.line_id];X[k.line_id]={conversionType:L.conversion_type,requestUomsSupported:L.request_uoms_supported,salesUomNormalised:L.sales_uom_normalised,salesUnitSize:L.sales_unit_size,salesUnitSizeUom:L.sales_unit_size_uom,coverageQty:L.coverage_qty,coverageUom:L.coverage_uom,roundingRule:L.rounding_rule,conversionConfidence:L.conversion_confidence,conversionNotes:L.conversion_notes,...P?.qty===0&&Number.isFinite(L.suggested_order_qty)&&L.suggested_order_qty>0?{qty:L.suggested_order_qty,unit:L.suggested_order_uom||P.unit}:{}}}Object.keys(X).length>0&&r(X)}).catch(N=>console.error("Catalogue conversion resolution failed",N)).finally(()=>{ue(N=>{let X={...N};for(let[Z,k]of E)X[Z]===k&&delete X[Z];return X})})},[e,r]);function ut(h){R(E=>{let N={...E};return delete N[h],N})}function G(h,E){let N=parseFloat(E);!isNaN(N)&&N>=0&&t(h,Math.min(N,1e5)),ut(h)}function pe(h,E,N){t(h,Math.min(1e5,Math.max(0,E+N))),ut(h)}function Me(h){A(E=>{let N={...E};return delete N[h],N})}function St(h,E){let N=parseFloat(E);!isNaN(N)&&N>=0&&a(h,Math.min(N,1e5)),Me(h)}function Ot(h,E,N){a(h,Math.min(1e5,Math.max(0,E+N))),Me(h)}async function Ut(){if(Ze.some(({pricing:E})=>E.lineTotal==null)){v("Confirm the highlighted quantities before requesting a quote.");return}let h=m.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h)){v(Sv);return}v(""),f(!0);try{let E=await fetch(za("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Cn()},body:JSON.stringify({email:h,items:Ze.map(({item:N,pricing:X})=>{let Z=X.requiredSellUnits??X.requestedAmount,k=X.requiredSellUnits!=null?X.sellUnit:X.requestedUnit;return{product_id:N.productId,description:N.description,quantity:Z,unit:xa(k,Z),unit_price:X.requiredSellUnits!=null?X.unitPrice:null,line_total:X.lineTotal}})})});if(!E.ok){let N=await Qa(E);console.error("Quote request failed",E.status,N?.message),v(E.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}Ve!=null&&u("quote_requested",{items:Ze.length,total:Math.round(Ve*100)/100}),T(!0),l?.(),window.scrollTo(0,0)}catch{v("Your request couldn't be sent. Check your connection and try again.")}finally{f(!1)}}let Ze=g.map(h=>({item:h,pricing:Ft(h,{wasteFactorEnabled:Oe,wasteFactorOverride:Math.max(0,Number.parseFloat(ke)||0)/100})})),Ne=tc(g,{wasteFactorEnabled:Oe,wasteFactorOverride:Math.max(0,Number.parseFloat(ke)||0)/100}),ve=Ne==null?null:Ne*Nv,Ve=Ne==null?null:Ne*(1+Nv),M=Ze.filter(({pricing:h})=>h.lineTotal==null).length,B=Object.keys(re).length,ie=!!r&&g.some(h=>{if(h.productId==="-"||Ft(h).requiredSellUnits!=null)return!1;let E=Un(h);return ye.current.get(h.lineId)!==E||re[h.lineId]===E}),se=(0,gt.useRef)({items:Ze.length,...Ve==null?{}:{total:Math.round(Ve*100)/100}});(0,gt.useEffect)(()=>{u("basket_viewed",se.current)},[u]);let he=Math.max(1,Math.ceil(Ze.length/nl)),ze=Math.min(Q,he),Ke=Ze.slice((ze-1)*nl,ze*nl);return y?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,q.jsx)("h1",{children:"Quote requested"}),(0,q.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,q.jsx)("strong",{children:m.trim()}),", usually within one working day."]}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Start a new quote"})}),(0,q.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):!c&&g.length===0?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,q.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,q.jsx)("h1",{children:d?"Your quote request is empty":"Your basket is empty"}),(0,q.jsx)("p",{children:d?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Back to start"})})]})}):(0,q.jsx)("div",{className:`wizard-step entry-stage${d?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[d&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:c?"Your Selection":d?"Request a quote":"Your Basket"}),c&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:g.length})," ",g.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":d?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:ie?(0,q.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,q.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,q.jsx)("span",{children:"Calculating your quantities\u2026"})]}):g.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,q.jsx)("p",{children:"Your selection is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":d?"Quote request items":"Basket items",children:Ke.map(({item:h,pricing:E})=>{let N=S[h.lineId]??String(E.requestedAmount),X=E.requestedUnit===E.sellUnit||E.costingMode==="review",Z=E.requiredSellUnits==null||E.requestedAmount!==E.requiredSellUnits||E.requestedUnit!==E.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ga(h.description,h.productId,h.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:h.description}),Z&&E.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Re(k=>({...k,[h.lineId]:!k[h.lineId]})),"aria-expanded":!!me[h.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${me[h.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(ol,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(h.lineId),"aria-label":`Remove ${h.description}`,children:(0,q.jsx)(Q_,{})})})]}),c&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:h.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:h.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:h.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[h.salesUnitSize," ",ka(h.salesUnitSizeUom,h.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:h.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[h.coverageQty," ",ka(h.coverageUom,h.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:h.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:h.roundingRule??"-"})]})]}),h.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:h.conversionNotes})]}),E.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:re[h.lineId]===Un(h)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",j_(E)]}):Z&&me[h.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:H_(h,E)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:N,disabled:X,onChange:k=>R(L=>({...L,[h.lineId]:k.target.value})),onBlur:k=>G(h.lineId,k.target.value),onKeyDown:k=>{k.key==="Enter"&&k.target.blur()},"aria-label":`${h.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:X,onClick:()=>pe(h.lineId,parseFloat(N)||0,1),"aria-label":`Increase ${h.description} quantity`,children:(0,q.jsx)(ol,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:X,onClick:()=>pe(h.lineId,parseFloat(N)||0,-1),"aria-label":`Decrease ${h.description} quantity`,children:(0,q.jsx)(ol,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(E.requestedUnit,parseFloat(N)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:z[h.lineId]??String(E.requiredSellUnits??""),onChange:k=>A(L=>({...L,[h.lineId]:k.target.value})),onBlur:k=>St(h.lineId,k.target.value),onKeyDown:k=>{k.key==="Enter"&&k.target.blur()},"aria-label":`${h.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ot(h.lineId,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${h.description} order quantity`,children:(0,q.jsx)(ol,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ot(h.lineId,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${h.description} order quantity`,children:(0,q.jsx)(ol,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(E.sellUnit,parseFloat(z[h.lineId]??String(E.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:E.lineTotal!=null?ot(E.lineTotal):"-"}),E.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},h.lineId)})}),he>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(ze-1)*nl+1,"\u2013",Math.min(ze*nl,Ze.length)," of ",Ze.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>K(ze-1),disabled:ze===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",ze," of ",he]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>K(ze+1),disabled:ze===he,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:d?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:d?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:Ne==null?"To confirm":ot(Ne)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:ve==null?"To confirm":ot(ve)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:d?"List price (inc.\xA0VAT)":"Total"}),(0,q.jsx)("span",{children:Ve==null?"To confirm":ot(Ve)})]}),!d&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:Oe,onChange:h=>Qe(h.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:ke,onChange:h=>we(h.target.value),disabled:!Oe,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:d?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:m,onChange:h=>{b(h.target.value),d&&v("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&w===Sv,"aria-describedby":d&&w?`${p}-basket-reference-error`:void 0}),d&&w&&(0,q.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:w}),d?(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Ut()},disabled:D||M>0||B>0,"aria-busy":D,children:(0,q.jsx)("span",{children:D?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{u("downloaded",{type:"basket",items:g.length}),wv(g)},"aria-label":c?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:c?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),d?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,q.jsx)(Zr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Na=Y(ee()),Rd="metron-quick-quote",G_=1440*60*1e3;function oc(e){return(0,Na.jsx)(ic,{children:(0,Na.jsx)(Y_,{...e})})}function Y_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,Be.useState)("entry"),[n,o]=(0,Be.useState)(null),[l,c]=(0,Be.useState)(""),p=(0,Be.useRef)(null),d=(0,Be.useRef)(0),[g,m]=(0,Be.useState)(0),[b,y]=(0,Be.useState)(null),[T,D]=(0,Be.useState)(!1),{cart:f,addToCart:u,addManyToCart:w,removeFromCart:v,updateCartQty:S,updateCartSellUnits:R,updateCartConversions:z,clearCart:A}=Dn(),[Q,K]=(0,Be.useState)(!1),[me,Re]=(0,Be.useState)(null),Oe=()=>{Re(null);try{window.sessionStorage.removeItem(ec)}catch{}},Qe=(0,Be.useRef)(null),ke=Xs("quick-quote",Qe);(0,Be.useEffect)(()=>{ke("viewed")},[ke]);let[we,re]=(0,Be.useState)(!1);(0,Be.useEffect)(()=>{sv();let Ne=window.location.hash,ve=null;try{ve=JSON.parse(window.sessionStorage.getItem(Rd)??"null")}catch{}if(ve&&!(Date.now()-(ve.savedAt??0)<G_)&&(ve=null),ve?.scheduleResult)o("schedule"),y(ve.scheduleResult),D(ve.reviewGateComplete),K(ve.cartSeeded),w(Object.values(ve.cart)),Ne==="#quote-request"?i("basket"):Ne==="#matched-products"&&i("results");else if(Ne==="#matched-products"||Ne==="#quote-request"){let Ve=new URL(window.location.href);Ve.hash="",Mn("replaceState",window.history.state,Ve)}re(!0)},[]),(0,Be.useEffect)(()=>{if(we)try{b?window.sessionStorage.setItem(Rd,JSON.stringify({savedAt:Date.now(),scheduleResult:b,reviewGateComplete:T,cartSeeded:Q,cart:f})):window.sessionStorage.removeItem(Rd)}catch{}},[we,b,T,Q,f]);let ue=(0,Be.useCallback)(Ne=>{if(typeof window>"u")return;let ve=new URL(window.location.href);ve.hash=Ne==="basket"?"quote-request":"matched-products";let Ve=Ne==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");Mn(Ve?"replaceState":"pushState",{boqQuoteStage:Ne},ve)},[]),ye=(0,Be.useRef)(!1);(0,Be.useEffect)(()=>{let Ne=()=>{ye.current=!1;let ve=window.location.hash;ve==="#quote-request"?i("basket"):ve==="#matched-products"&&b?(o("schedule"),i("results")):i("entry")};return window.addEventListener("popstate",Ne),()=>window.removeEventListener("popstate",Ne)},[b]);let ut=(0,Be.useCallback)(()=>{ue("basket"),i("basket")},[ue]),G=(0,Be.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(ye.current)return;ye.current=!0,Ws();return}i(b?"results":"entry")},[b]),pe=(0,Be.useRef)(r);(0,Be.useEffect)(()=>{pe.current!==r&&(pe.current=r,window.scrollTo(0,0))},[r]);let Me=()=>{i("entry"),o(null),c(""),m(0),y(null),D(!1),A(),K(!1),Oe()},St=(0,Be.useCallback)(async(Ne,ve,Ve=!0)=>{let M=++d.current;c(""),m(0);let B=0,ie=()=>{B=Math.min(B+1,3),m(B)};try{let{jobId:se}=await hw(Ne,ve,Ve);if(M!==d.current)return;let{promise:he,cancel:ze}=bw(()=>gw(se),5e3,ie,"schedule");p.current=ze;let Ke=await he;if(Ke.status==="failed"||!Ke.result)throw new Error(Ke.error||"Failed to process schedule");let h=Ke.result.lineItems.length,E=Ke.result.results.filter(N=>N.candidates.length>0).length;ke("results_shown",{lines:h,matched:E,unmatched:h-E}),A(),K(!1),D(!1),y(Ke.result),ue("results"),i("results")}catch(se){if(M!==d.current)return;ke("error",{stage:"matching"}),c(se?.message||"Failed to process schedule"),i("entry")}finally{M===d.current&&(p.current?.(),p.current=null)}},[ue,ke,A]),Ot=(0,Be.useCallback)(()=>{d.current++,p.current?.(),p.current=null},[]),Ut=(0,Be.useCallback)(async(Ne,ve,Ve=!0)=>{if(!Ne.trim())return;o("schedule");let M=new File([Ne],"pasted-schedule.txt",{type:"text/plain"});await St(M,ve,Ve)},[St]),Ze=(0,Be.useCallback)(async Ne=>{o("schedule"),await St(Ne)},[St]);return(0,Na.jsx)(Jo.Provider,{value:ke,children:(0,Na.jsx)("div",{ref:Qe,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:jt().theme,children:(0,Na.jsxs)("main",{className:"main-content",children:[l&&(0,Na.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Na.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Na.jsx)(xd,{onPasteSchedule:Ut,onUploadSchedule:Ze,onEntryModeChange:o,draft:me,onSubmitDraft:Re,onCancelMatch:Ot}),r==="results"&&n==="schedule"&&b&&(0,Na.jsx)(Td,{scheduleResult:b,onStartOver:Me,cart:f,onAddToCart:u,onRemoveFromCart:v,onGoToBasket:ut,cartSeeded:Q,onCartSeeded:()=>K(!0),reviewGateComplete:T,onReviewGateComplete:()=>D(!0),internal:a}),r==="basket"&&(0,Na.jsx)(ll,{cart:f,onUpdateQty:S,onUpdateSellUnits:R,onResolveConversions:z,onRemove:v,onBack:G,onStartNewQuote:Me,onQuoteRequested:()=>{y(null),D(!1),K(!1),A(),Oe()},internal:a})]})})})}var Xa=Y(Ge());var _i=Y(Ge()),W=Y(ee()),Cv=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],lc=e=>Number.parseFloat(e)||0,qv=(e,t)=>lc(e)*(t==="m"?1:.3048),Ud=(e,t)=>lc(e.quantity)*(2*qv(e.height,t)+qv(e.width,t)),X_=()=>({quantity:"1",width:"",height:""});function V_({profile:e}){return(0,W.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,W.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,W.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Dd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,_i.useState)("m"),[n,o]=(0,_i.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,_i.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,d]=(0,_i.useState)([]),[g,m]=(0,_i.useState)("ogee"),[b,y]=(0,_i.useState)("2.4"),T=(S,R,z)=>{S(A=>({...A,[R]:z}))},D=Ud(n,r)+Ud(l,r)+p.reduce((S,R)=>S+Ud(R,r),0),f=lc(b)>0?Math.ceil(D/lc(b)):0,u=Cv.find(S=>S.id===g)?.label??"",w=[{key:`architrave-${g}`,label:`Architrave (${u})`,qty:D,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(S,R,z,A)=>(0,W.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,W.jsx)("span",{children:S}),(0,W.jsx)("input",{"aria-label":`${S} quantity`,type:"number",min:"0",step:"1",value:R.quantity,onChange:Q=>z("quantity",Q.target.value)}),(0,W.jsx)("input",{"aria-label":`${S} width`,type:"number",min:"0",step:"0.01",value:R.width,onChange:Q=>z("width",Q.target.value)}),(0,W.jsx)("input",{"aria-label":`${S} height`,type:"number",min:"0",step:"0.01",value:R.height,onChange:Q=>z("height",Q.target.value)}),A?(0,W.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:A,children:"Remove"}):null]});return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"truss-estimator",children:[(0,W.jsxs)("div",{className:"quick-order-hero",children:[(0,W.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,W.jsx)("h1",{children:"Architrave Calculator"}),(0,W.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,W.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,W.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,W.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,W.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,W.jsx)("span",{children:"Units"}),(0,W.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,W.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,W.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,W.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,W.jsx)("span",{children:"Opening"}),(0,W.jsx)("span",{children:"Qty"}),(0,W.jsxs)("span",{children:["Width (",r,")"]}),(0,W.jsxs)("span",{children:["Height (",r,")"]}),(0,W.jsx)("span",{})]}),v("Single doors",n,(S,R)=>T(o,S,R)),v("Double doors",l,(S,R)=>T(c,S,R)),p.map((S,R)=>v(`Alternative door ${R+1}`,S,(z,A)=>d(Q=>Q.map((K,me)=>me===R?{...K,[z]:A}:K)),()=>d(z=>z.filter((A,Q)=>Q!==R)))),(0,W.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(S=>[...S,X_()]),children:"+ Add alternative-sized door"})]}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,W.jsx)("div",{className:"architrave-calculator__profiles",children:Cv.map(S=>(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===S.id?" is-selected":""}`,onClick:()=>m(S.id),children:[(0,W.jsx)(V_,{profile:S.id}),(0,W.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,W.jsxs)("div",{className:"architrave-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,W.jsx)("div",{className:"architrave-calculator__options",children:(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsx)("span",{children:"Board length (m)"}),(0,W.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,W.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,W.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,W.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Architrave needed"}),(0,W.jsxs)("strong",{children:[D.toFixed(2)," m"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Board lengths"}),(0,W.jsx)("strong",{children:f})]})]})]}),(0,W.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,W.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,W.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:D<=0,children:a})]})]})]})})}var xi=Y(Ge()),oe=Y(ee()),Ev=60,Mv=10,$_=.02,Z_=.012,K_=.01,On=e=>Number.parseFloat(e)||0,P_=(e,t=2)=>e.toFixed(t);function Od({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,xi.useState)("brick"),[n,o]=(0,xi.useState)("engineering-red"),[l,c]=(0,xi.useState)("metric"),[p,d]=(0,xi.useState)(""),[g,m]=(0,xi.useState)(""),[b,y]=(0,xi.useState)(!0),T=l==="metric"?On(p)*On(g):On(p)*On(g)*.092903,f=T*(r==="brick"?Ev:Mv),u=Math.ceil(f),w=T*(r==="brick"?$_:Z_),v=Math.ceil(w/K_),S=l==="metric"?T:T*10.7639,R=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],z=A=>{if(A===l)return;let Q=A==="imperial"?3.28084:.3048;d((On(p)*Q).toFixed(2)),m((On(g)*Q).toFixed(2)),c(A)};return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Brick and Block Calculator"}),(0,oe.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,oe.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([A,Q])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===A?" is-selected":""}`,onClick:()=>i(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,oe.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",A==="brick"?Ev:Mv," per m\xB2"]})]},A))})]}),r==="brick"&&(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([A,Q,K])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===A?" is-selected":""}`,onClick:()=>o(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:Q}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:K})]},A))})]}),(0,oe.jsxs)("div",{className:"brick-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,oe.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,oe.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>z("metric"),children:"Metric"}),(0,oe.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>z("imperial"),children:"Imperial"})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:A=>d(A.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:A=>m(A.target.value)})]})]})]}),(0,oe.jsx)("div",{className:"brick-calculator__options",children:(0,oe.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,oe.jsx)("input",{type:"checkbox",checked:b,onChange:A=>y(A.target.checked)}),(0,oe.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,oe.jsxs)("div",{className:"brick-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Wall area"}),(0,oe.jsxs)("strong",{children:[P_(S)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,oe.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Ready-mixed mortar"}),(0,oe.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,oe.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,oe.jsxs)("div",{className:"brick-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(R),disabled:T<=0,children:a})]})]})]})})}var hr=Y(Ge());var J_={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501",mortar:"646"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-ovolo":"1531","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},insulation:{"insulation-floor":"152187","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142",gate:"1984","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"23995","surface-raj":"12369","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function Bd(e,t){let a=J_[jt().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function Tv(e,t){let a=t.map(r=>{let i=Bd(e,r);return i?{key:r.key,productId:i.split(" ")[0],search:i,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var zv=new Map;function I_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function fr(e,t,a=12,r){let i=`${jt().client??""}||${e}||${t??""}||${a}||${r??""}`,n=zv.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(za(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Qa(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(I_):[];return zv.set(i,p),p}var F_=new Set(["bag","box","roll","pack"]),W_=new Set(["each","bag","box","roll","pack","tub"]);function Ld(e,t){let a=t?.uoi,r=a!=null&&W_.has(a.toLowerCase())&&(t?.uoi_count??1)===1;return F_.has(e)&&r?a:e}async function Av(e,t,a){return await Promise.all(e.map(async i=>{try{let n=a?Bd(a,i):null,[o,l]=await Promise.all([n?fr(n,void 0,void 0,t).then(p=>p.find(d=>d.product_id===n.split(" ")[0]),()=>{}):void 0,fr(i.query,i.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:{...i,unit:Ld(i.unit,c[0])},candidates:c}}catch{return{requirement:i,candidates:[]}}}))}async function Rv(){let e=await fetch(za("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Qa(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var V=Y(ee()),ex=1.54,tx=1440,ax=25,Hd=800,rx=1500,jd=e=>Number.parseFloat(e)||0,Bn={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function Qd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=nc(),[i,n]=(0,hr.useState)("m"),[o,l]=(0,hr.useState)(""),[c,p]=(0,hr.useState)(""),[d,g]=(0,hr.useState)(""),[m,b]=(0,hr.useState)("concrete"),[y,T]=(0,hr.useState)("mot"),[D,f]=(0,hr.useState)(!1),[u,w]=(0,hr.useState)(null),v=i==="m"?1:.3048,S=jd(o)*v*jd(c)*v*jd(d)*(i==="m"?.01:.0254),R=Bn[y],z=S*ex/7,A=z*tx,Q=z*2,K=z*4,me=Math.ceil(A/ax),Re=Math.ceil(Q*Bn["sharp-sand"].density*1e3/Hd),Oe=Math.ceil(K*Bn.gravel.density*1e3/Hd),Qe=Math.ceil(S*R.density*1e3/Hd),ke=m==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:me,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Re,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:Oe,productId:"6001004"}]:[{key:y,label:`${R.label} Bulk Bag (800kg)`,qty:Qe,productId:R.productId}],we=()=>{if(t){t(ke.map(ue=>({key:ue.key,label:ue.label,qty:ue.qty,unit:"each",query:ue.productId})));return}re()},re=async()=>{let ue=Date.now();f(!0),w(null);try{let ye=await Promise.all(ke.map(async G=>{let pe=(await fr(G.productId)).find(Me=>Me.product_id===G.productId);if(!pe)throw new Error(`${G.label} is no longer available in this catalogue.`);return Kr(pe,{lineId:`concrete-aggregate:${G.key}`,description:G.label,unit:"bag",qty:G.qty})})),ut=rx-(Date.now()-ue);ut>0&&await new Promise(G=>window.setTimeout(G,ut)),r?.clearCart(),r?.addManyToCart(ye),r?.openBasket()}catch(ye){w(ye instanceof Error?ye.message:"Could not add the products to your basket.")}finally{f(!1)}};return D?(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Your Materials"}),(0,V.jsx)("p",{children:"Calculating quantities from the Concrete and Aggregate Calculator."})]}),(0,V.jsx)("div",{className:"truss-estimator__card",children:(0,V.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,V.jsx)(dr,{}),(0,V.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,V.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,V.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,V.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,V.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,V.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="concrete"?" is-selected":""}`,onClick:()=>b("concrete"),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="aggregate"?" is-selected":""}`,onClick:()=>b("aggregate"),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),m==="aggregate"&&(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,V.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Bn).map(ue=>(0,V.jsxs)("button",{type:"button",className:`truss-estimator__option-card${y===ue?" is-selected":""}`,onClick:()=>T(ue),children:[(0,V.jsx)("div",{className:"truss-estimator__option-title",children:Bn[ue].label}),(0,V.jsx)("div",{className:"truss-estimator__option-copy",children:Bn[ue].blurb})]},ue))})]}),(0,V.jsxs)("div",{className:"materials-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,V.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,V.jsx)("span",{children:"Units"}),(0,V.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,V.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metric"}),(0,V.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Imperial"})]})]}),(0,V.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsxs)("span",{children:["Length (",i,")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ue=>l(ue.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsxs)("span",{children:["Width (",i,")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ue=>p(ue.target.value)})]})]}),(0,V.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,V.jsxs)("span",{children:["Depth (",i==="m"?"cm":"inches",")"]}),(0,V.jsx)("input",{type:"number",min:"0",step:"0.1",value:d,onChange:ue=>g(ue.target.value)})]})]}),(0,V.jsxs)("div",{className:"materials-calculator__totals",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,V.jsx)("div",{className:"materials-calculator__result-grid",children:m==="concrete"?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Cement"}),(0,V.jsxs)("strong",{children:[A.toFixed(0)," kg"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Sharp sand"}),(0,V.jsxs)("strong",{children:[Q.toFixed(2)," m\xB3"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"20mm aggregate"}),(0,V.jsxs)("strong",{children:[K.toFixed(2)," m\xB3"]})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:R.label}),(0,V.jsxs)("strong",{children:[S.toFixed(2)," m\xB3"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Approx. weight"}),(0,V.jsxs)("strong",{children:[(S*R.density).toFixed(2)," t"]})]}),(0,V.jsx)("div",{})]})}),(0,V.jsx)("p",{className:"materials-calculator__note",children:m==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),u&&(0,V.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,V.jsxs)("div",{className:"materials-calculator__actions",children:[(0,V.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,V.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:we,disabled:S<=0||D,children:D?"Adding products\u2026":a})]})]})]})})}var Ya=Y(Ge());var U=Y(ee()),Ln=12,Hn=8,sc=.56,Uv=.21,Aa={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},ki=["range","grid","pictureFrame","substructure"],ix={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},cc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),uc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),nx=(e,t,a,r)=>{let i=cc(e,t,a),n=cc(e,t,r),o=cc(a,r,e),l=cc(a,r,t);return i===0&&uc(e,t,a)||n===0&&uc(e,t,r)||o===0&&uc(a,r,e)||l===0&&uc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Gd=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&nx(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Yd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ya.useState)(0),[n,o]=(0,Ya.useState)(ix),[l,c]=(0,Ya.useState)(1),[p,d]=(0,Ya.useState)({x:0,y:0}),[g,m]=(0,Ya.useState)(null),b=(0,Ya.useRef)(null),y=(0,Ya.useRef)(null),T=(0,Ya.useRef)(null),D=ki[r],f=n.range?Aa.ranges[n.range]:null,u=Ln/l,w=Hn/l,v=(Ln-u)/2,S=(Hn-w)/2,R=Math.max(-Ln,Math.min(Ln*2-u,v+p.x)),z=Math.max(-Hn,Math.min(Hn*2-w,S+p.y)),A=Number.parseFloat(n.quickLengthM),Q=Number.parseFloat(n.quickWidthM),K=A>0&&Q>0,me=M=>Math.abs(M.reduce((B,ie,se)=>{let he=M[(se+1)%M.length];return B+ie.x*he.y-he.x*ie.y},0))/2,Re=(M,B)=>Math.hypot(B.x-M.x,B.y-M.y),Oe=n.isOutlineClosed?me(n.points):0,Qe=n.isOutlineClosed?n.points.reduce((M,B,ie)=>M+Re(B,n.points[(ie+1)%n.points.length]),0):0,ke=n.isOutlineClosed?n.points.reduce((M,B,ie)=>M+(n.wallSegments.has(ie)?0:Re(B,n.points[(ie+1)%n.points.length])),0):0,we=n.points.reduce((M,B)=>({x:M.x+B.x/n.points.length,y:M.y+B.y/n.points.length}),{x:0,y:0}),re=n.points.length>1?(()=>{let M=n.points[0],B=n.points[1],ie=Re(M,B),se=ie?-(B.y-M.y)/ie:0,he=ie?(B.x-M.x)/ie:0,ze=(M.x+B.x)/2,Ke=(M.y+B.y)/2,h=se*(ze-we.x)+he*(Ke-we.y)>=0?1:-1;return{x:ze+se*sc*h,y:Ke+he*sc*h}})():null,ye=(()=>{let M=n.range?Aa.ranges[n.range]:Aa.ranges.meridian,B=n.deckSizeMode==="quick"?A*Q:Oe,ie=n.deckSizeMode==="quick"?2*(A+Q):ke,se=n.direction==="diagonal"?Aa.wastage.diagonal:Aa.wastage.straight,he=n.pictureFrame==="yes"?Aa.pictureFrame.extraWastage:0,Ke=B/(M.boardWidthM+Aa.boardGapM)/M.boardLengthM,h=Math.ceil(Ke*(1+se+he)),E=Math.ceil(B*30*(1+se+he)/200),N=Aa.joist.spacingOptions.find(k=>k.id===n.joistSpacing)??Aa.joist.spacingOptions[1],X=B/N.spacingM,Z=Math.ceil(X);return{range:M,area:B,boardCount:h,screwBoxes:E,joistMetres:Z,spacing:N}})(),ut=ye?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${ye.range.label})`,qty:ye.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ye.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ye.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],G=()=>D==="range"?!!n.range:D==="grid"?n.deckSizeMode==="quick"?K:n.isOutlineClosed&&Oe>0:D==="pictureFrame"?!!n.pictureFrame&&!!n.direction:D==="substructure"?!!n.joistSpacing:!0,pe=r===ki.length-1?a:"Next",Me=(M,B,ie=!1)=>{let se=T.current?.getBoundingClientRect();if(!se)return null;let he=ie?1:.25;return{x:Math.round(Math.max(R,Math.min(R+u,R+(M-se.left)/se.width*u))/he)*he,y:Math.round(Math.max(z,Math.min(z+w,z+(B-se.top)/se.height*w))/he)*he}},St=M=>{if(n.isOutlineClosed){let ie=M.target;if(ie!==M.currentTarget&&!ie.classList.contains("deck-outline__grid"))return;y.current={startX:M.clientX,startY:M.clientY,startViewX:R,startViewY:z},M.currentTarget.setPointerCapture(M.pointerId);return}if(n.drawMode!=="outline")return;let B=Me(M.clientX,M.clientY,!0);B&&(m(null),o(ie=>{let se=[...ie.points,B];return Gd(se,!1)?{...ie,drawError:"Edges cannot cross. Choose another corner."}:{...ie,points:se,drawError:""}}))},Ot=(M,B)=>{if(!n.isOutlineClosed){M.stopPropagation(),B===0&&n.points.length>=3&&o(ie=>({...ie,isOutlineClosed:!0,drawMode:"edges"}));return}M.stopPropagation(),b.current=B,M.currentTarget.setPointerCapture(M.pointerId)},Ut=M=>{if(y.current){let se=T.current?.getBoundingClientRect();if(!se)return;let he=y.current,ze=he.startViewX-(M.clientX-he.startX)/se.width*u,Ke=he.startViewY-(M.clientY-he.startY)/se.height*w;d({x:ze-v,y:Ke-S});return}!n.isOutlineClosed&&n.drawMode==="outline"&&m(Me(M.clientX,M.clientY,!0));let B=b.current;if(B===null)return;let ie=Me(M.clientX,M.clientY);ie&&o(se=>{let he=se.points.map((ze,Ke)=>Ke===B?ie:ze);return Gd(he,!0)?{...se,drawError:"Edges cannot cross. Move the corner to a different position."}:{...se,points:he,drawError:""}})},Ze=M=>{y.current=null,b.current=null,M.currentTarget.hasPointerCapture(M.pointerId)&&M.currentTarget.releasePointerCapture(M.pointerId)},Ne=M=>{o(B=>{let ie=new Set(B.wallSegments);return ie.has(M)?ie.delete(M):ie.add(M),{...B,wallSegments:ie}})},ve=()=>{r===0?e():i(M=>M-1)},Ve=()=>{G()&&(r===ki.length-1?t?.(ut):i(M=>M+1))};return(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)("div",{className:"truss-estimator",children:[(0,U.jsxs)("div",{className:"quick-order-hero",children:[(0,U.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,U.jsx)("h1",{children:"Decking Calculator"}),(0,U.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,U.jsxs)("div",{className:"truss-estimator__card",children:[(0,U.jsxs)("div",{className:"truss-estimator__body",children:[D==="range"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Aa.ranges).map(([M,B])=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===M?" is-selected":""}`,onClick:()=>o(ie=>({...ie,range:M})),children:[(0,U.jsx)("div",{className:"truss-estimator__option-title",children:B.label}),(0,U.jsx)("div",{className:"truss-estimator__option-copy",children:B.blurb}),(0,U.jsxs)("div",{className:"truss-estimator__option-copy",children:[B.boardLengthM,"m boards"]})]},M))})]}):null,D==="grid"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,U.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(M=>({...M,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,U.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(M=>({...M,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Length (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:M=>o(B=>({...B,quickLengthM:M.target.value}))})]}),(0,U.jsxs)("label",{className:"truss-estimator__field",children:[(0,U.jsx)("span",{children:"Width (m)"}),(0,U.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:M=>o(B=>({...B,quickWidthM:M.target.value}))})]})]}),(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),K?(0,U.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,U.jsxs)("div",{children:[(A*Q).toFixed(2)," m\xB2 deck"]}),(0,U.jsxs)("div",{children:[(2*(A+Q)).toFixed(2)," m perimeter"]})]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,U.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,U.jsxs)("div",{className:"deck-outline__summary",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Deck area"}),(0,U.jsxs)("strong",{children:[Oe.toFixed(2)," m\xB2"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Perimeter"}),(0,U.jsxs)("strong",{children:[Qe.toFixed(2)," m"]})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Wall edges"}),(0,U.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"Visible edge"}),(0,U.jsxs)("strong",{children:[ke.toFixed(2)," m"]})]})]}):null,(0,U.jsxs)("div",{className:"deck-outline__actions",children:[(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(M=>({...M,points:M.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m(null),o(M=>({...M,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,U.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(M=>({...M,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,U.jsx)("div",{className:"deck-editor-layout",children:(0,U.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,U.jsxs)("div",{className:"deck-outline",children:[(0,U.jsxs)("svg",{ref:T,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${R} ${z} ${u} ${w}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:St,onPointerMove:Ut,onPointerUp:Ze,onPointerLeave:()=>{m(null),y.current||(b.current=null)},children:[(0,U.jsx)("defs",{children:(0,U.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,U.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,U.jsx)("rect",{x:-Ln,y:-Hn,width:Ln*3,height:Hn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,U.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(M=>`${M.x},${M.y}`).join(" ")}):null,n.isOutlineClosed?(0,U.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(M=>`${M.x},${M.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((M,B)=>{let ie=n.points[n.isOutlineClosed?(B+1)%n.points.length:B+1],se=Re(M,ie),he=se?-(ie.y-M.y)/se:0,ze=se?(ie.x-M.x)/se:0,Ke=(M.x+ie.x)/2,h=(M.y+ie.y)/2,E=he*(Ke-we.x)+ze*(h-we.y)>=0?1:-1,N=Ke+he*sc*E,X=h+ze*sc*E;return(0,U.jsxs)("g",{children:[(0,U.jsx)("line",{className:"deck-outline__edge-hit",x1:M.x,y1:M.y,x2:ie.x,y2:ie.y,onClick:n.isOutlineClosed?()=>Ne(B):void 0}),(0,U.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(B)?" is-wall":""}`,x1:M.x,y1:M.y,x2:ie.x,y2:ie.y,pointerEvents:"none"}),(0,U.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(B)?" is-wall":""}`,x:N,y:X,textAnchor:"middle",dominantBaseline:"central",fontSize:Uv/l,children:[se.toFixed(2)," m"]})]},`segment-${B}`)}):null,!n.isOutlineClosed&&n.points.length>0&&g?(()=>{let M=n.points[n.points.length-1],B=Re(M,g);if(!B)return null;let ie=-(g.y-M.y)/B,se=(g.x-M.x)/B,he=(M.x+g.x)/2,ze=(M.y+g.y)/2;return(0,U.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,U.jsx)("line",{x1:M.x,y1:M.y,x2:g.x,y2:g.y}),(0,U.jsxs)("text",{x:he+ie*.34,y:ze+se*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:Uv/l,children:[B.toFixed(2)," m"]})]})})():null,n.points.map((M,B)=>(0,U.jsx)("circle",{className:"deck-outline__point",cx:M.x,cy:M.y,r:"0.13",onPointerDown:ie=>Ot(ie,B)},`point-${B}`))]}),(0,U.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,U.jsx)("button",{type:"button",onClick:()=>c(M=>Math.max(.5,M-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,U.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,U.jsx)("button",{type:"button",onClick:()=>c(M=>Math.min(1,M+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&re?(0,U.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(re.x-R)/u*100}%`,top:`${(re.y-z)/w*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,U.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(M=>Gd(M.points,!0)?{...M,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...M,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,U.jsxs)("div",{className:"deck-outline__supporting",children:[(0,U.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,U.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,D==="pictureFrame"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(M=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===M.id?" is-selected":""}`,onClick:()=>o(B=>({...B,pictureFrame:M.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(M.img),alt:""}),(0,U.jsx)("span",{children:M.label})]},M.id))}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(M=>(0,U.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===M.id?" is-selected":""}`,onClick:()=>o(B=>({...B,direction:M.id})),children:[(0,U.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(M.img),alt:""}),(0,U.jsx)("span",{children:M.label})]},M.id))})]})]}):null,D==="substructure"?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,U.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,U.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,U.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,U.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Aa.joist.spacingOptions.map(M=>(0,U.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===M.id?" is-selected":""}`,onClick:()=>o(B=>({...B,joistSpacing:M.id})),children:(0,U.jsx)("div",{className:"truss-estimator__option-title",children:M.label})},M.id))})]}):null]}),(0,U.jsxs)("div",{className:"truss-estimator__nav",children:[(0,U.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ve,children:"Back"}),(0,U.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:Ve,disabled:!G(),children:[(0,U.jsx)("span",{children:pe}),(0,U.jsx)("span",{className:"arrow",children:(0,U.jsx)(Qt,{})})]})]})]})]})})}var Ca=Y(Ge());var j=Y(ee()),Dv=12,Ov=30,jn=12,Qn=8,Bv=.56,Sa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ni=["range","height","gate","posts"],ox={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},pc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),dc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),lx=(e,t,a,r)=>{let i=pc(e,t,a),n=pc(e,t,r),o=pc(a,r,e),l=pc(a,r,t);return i===0&&dc(e,t,a)||n===0&&dc(e,t,r)||o===0&&dc(a,r,e)||l===0&&dc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},mc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&lx(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function Xd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ca.useState)(0),[n,o]=(0,Ca.useState)(ox),l=(0,Ca.useRef)(null),c=(0,Ca.useRef)(null),[p,d]=(0,Ca.useState)(1),[g,m]=(0,Ca.useState)({x:0,y:0}),[b,y]=(0,Ca.useState)(null),T=(0,Ca.useRef)(null),D=(0,Ca.useRef)(null),f=(0,Ca.useRef)(null),u=Ni[r],w=n.range?Sa.ranges[n.range]:null,v=jn/p,S=Qn/p,R=(jn-v)/2,z=(Qn-S)/2,A=Math.max(-jn,Math.min(jn*2-v,R+g.x)),Q=Math.max(-Qn,Math.min(Qn*2-S,z+g.y)),K=n.boundaryPoints.reduce((h,E)=>({x:h.x+E.x/Math.max(1,n.boundaryPoints.length),y:h.y+E.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),me=h=>{let E=new Set,N=[];return h.forEach(X=>{let[Z,k]=X.split(",").map(Number),L=[{key:`H,${Z},${k}`,type:"H",x:Z,y:k},{key:`H,${Z},${k+1}`,type:"H",x:Z,y:k+1},{key:`V,${Z},${k}`,type:"V",x:Z,y:k},{key:`V,${Z+1},${k}`,type:"V",x:Z+1,y:k}],P=[!h.has(`${Z},${k-1}`),!h.has(`${Z},${k+1}`),!h.has(`${Z-1},${k}`),!h.has(`${Z+1},${k}`)];L.forEach((ce,_e)=>{P[_e]&&!E.has(ce.key)&&(E.add(ce.key),N.push(ce))})}),N},Re=(h,E)=>me(h).filter(N=>!E.has(N.key)),Oe=(h,E)=>Re(h,E).length,Qe=(h,E)=>{let N={};Re(h,E).forEach(Z=>{var k,L,P,ce;Z.type==="H"?((N[k=`${Z.x},${Z.y}`]||(N[k]=[])).push("H"),(N[L=`${Z.x+1},${Z.y}`]||(N[L]=[])).push("H")):((N[P=`${Z.x},${Z.y}`]||(N[P]=[])).push("V"),(N[ce=`${Z.x},${Z.y+1}`]||(N[ce]=[])).push("V"))});let X=0;return Object.values(N).forEach(Z=>{(Z.length===1||Z.length===2&&Z[0]!==Z[1]||Z.length>=3)&&(X+=1)}),X},we=(()=>{let h=n.range?Sa.ranges[n.range]:Sa.ranges.boundary,E=n.height??"1.8",N=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Yt,br,yt)=>Yt+(n.excludedBoundaryEdges.has(yt)?0:Math.hypot(n.boundaryPoints[yt+1].x-br.x,n.boundaryPoints[yt+1].y-br.y)),0):0,X=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||Sa.gate[n.gateType].widthDefault:0,Z=Math.max(0,N-X),k=Z>0?Math.ceil(Z/h.panelWidthM):0,L=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,P=n.boundaryMode==="quick"?Z>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,L?-1:void 0).reduce((Yt,br,yt)=>{let Ci=yt>0&&!n.excludedBoundaryEdges.has(yt-1),sm=yt<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has(yt);return Yt+(Ci||sm?1:0)},0):0,ce=Z>0?Math.ceil(Z/h.panelWidthM)+1:0,_e=Math.max(0,ce-P),vt=n.mountingType?Sa.mounting[n.mountingType]:Sa.mounting.concrete,rt=n.gateType&&n.gateType!=="none"?2:0,Ct=_e+P+rt,lm=n.mountingType==="postcrete"?Ct*Sa.mounting.postcrete.bagsPerPost:0,Jr=n.gravelBoard==="yes"?k:0;return{range:h,height:E,totalEdgeM:N,fencedLengthM:Z,gateWidthM:X,panelsCount:k,cornerPostCount:P,intermediatePostCount:_e,gatePostCount:rt,totalPostCount:Ct,bagsCount:lm,gravelCount:Jr,capCount:Ct,mounting:vt}})(),re=n.gateType&&n.gateType!=="none"?Sa.gate[n.gateType].label:null,ue=Number(we.height)<=1.2?"6":"8",ye=we?[{key:`panels-${n.range??"boundary"}-${we.height}`,label:`${we.range.label} panels (${we.height}m)`,qty:we.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${ue}`,label:"Intermediate concrete posts",qty:we.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ue}`,label:"End and corner concrete posts",qty:we.cornerPostCount+we.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ue}`,label:"Timber fence posts",qty:we.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:we.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...re?[{key:"gate",label:re,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...we.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:we.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ut=()=>{if(u==="range"){let h=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&h}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},G=r===Ni.length-1?a:"Next",pe=h=>{o(E=>{let N=h(new Set(E.grid)),X=new Set([...E.excludedEdges].filter(Z=>me(N).some(k=>k.key===Z)));return{...E,grid:N,excludedEdges:X}})},Me=(h,E,N)=>{pe(X=>{let Z=`${h},${E}`;return N?X.add(Z):X.delete(Z),X})},St=(h,E,N,X,Z)=>{let k=h,L=E,P=Math.abs(N-h),ce=h<N?1:-1,_e=-Math.abs(X-E),vt=E<X?1:-1,rt=P+_e;for(;Me(k,L,Z),!(k===N&&L===X);){let Ct=2*rt;Ct>=_e&&(rt+=_e,k+=ce),Ct<=P&&(rt+=P,L+=vt)}},Ot=(h,E)=>{let N=c.current?.getBoundingClientRect();if(!N)return null;let X=Math.floor((h-N.left)/Ov),Z=Math.floor((E-N.top)/Ov);return X<0||Z<0||X>=Dv||Z>=Dv?null:{x:X,y:Z}},Ut=h=>{if(n.gridMode!=="draw")return;let E=Ot(h.clientX,h.clientY);if(!E)return;h.preventDefault();let N=`${E.x},${E.y}`,X=!n.grid.has(N);l.current={active:!0,paintValue:X,lastX:E.x,lastY:E.y},h.currentTarget.setPointerCapture(h.pointerId),Me(E.x,E.y,X)},Ze=h=>{let E=l.current;if(!E?.active)return;let N=Ot(h.clientX,h.clientY);N&&(N.x===E.lastX&&N.y===E.lastY||(St(E.lastX,E.lastY,N.x,N.y,E.paintValue),l.current={...E,lastX:N.x,lastY:N.y}))},Ne=h=>{l.current?.active&&(l.current=null,h.currentTarget.releasePointerCapture(h.pointerId))},ve=(h,E,N=!1)=>{let X=f.current?.getBoundingClientRect();if(!X)return null;let Z=N?1:.25;return{x:Math.round(Math.max(A,Math.min(A+v,A+(h-X.left)/X.width*v))/Z)*Z,y:Math.round(Math.max(Q,Math.min(Q+S,Q+(E-X.top)/X.height*S))/Z)*Z}},Ve=h=>{if(n.boundaryClosed){let N=h.target;if(N!==h.currentTarget&&!N.classList.contains("fence-boundary__grid"))return;D.current={startX:h.clientX,startY:h.clientY,startViewX:A,startViewY:Q},h.currentTarget.setPointerCapture(h.pointerId);return}let E=ve(h.clientX,h.clientY,!0);E&&(y(null),o(N=>{let X=[...N.boundaryPoints,E];return mc(X,!1)?{...N}:{...N,boundaryPoints:X}}))},M=(h,E)=>{if(h.stopPropagation(),!n.boundaryClosed){if(E!==0||n.boundaryPoints.length<3)return;o(N=>mc(N.boundaryPoints,!0)?N:{...N,boundaryPoints:[...N.boundaryPoints,N.boundaryPoints[0]],boundaryClosed:!0});return}T.current=E,h.currentTarget.setPointerCapture(h.pointerId)},B=h=>{if(D.current){let N=f.current?.getBoundingClientRect();if(!N)return;let X=D.current,Z=X.startViewX-(h.clientX-X.startX)/N.width*v,k=X.startViewY-(h.clientY-X.startY)/N.height*S;m({x:Z-R,y:k-z});return}if(n.boundaryClosed||y(ve(h.clientX,h.clientY,!0)),T.current===null)return;let E=ve(h.clientX,h.clientY);E&&o(N=>{let X=N.boundaryPoints.length>2&&N.boundaryPoints[0].x===N.boundaryPoints[N.boundaryPoints.length-1].x&&N.boundaryPoints[0].y===N.boundaryPoints[N.boundaryPoints.length-1].y,Z=N.boundaryPoints.map((k,L)=>{let P=L===T.current,ce=X&&T.current===0&&L===N.boundaryPoints.length-1;return P||ce?E:k});return mc(Z,!1)?N:{...N,boundaryPoints:Z}})},ie=h=>{D.current=null,T.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},se=h=>{o(E=>{let N=new Set(E.excludedBoundaryEdges);return N.has(h)?N.delete(h):N.add(h),{...E,excludedBoundaryEdges:N}})},he=()=>{r===0?e():i(h=>h-1)},ze=()=>{ut()&&(r===Ni.length-1?t?.(ye):i(h=>h+1))},Ke=me(n.grid);return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"truss-estimator",children:[(0,j.jsxs)("div",{className:"quick-order-hero",children:[(0,j.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,j.jsx)("h1",{children:"Fencing Calculator"}),(0,j.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,j.jsxs)("div",{className:"truss-estimator__card",children:[(0,j.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([h,E])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===h?" is-selected":""}`,onClick:()=>o(N=>({...N,range:h})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:E.blurb})]},h))})]}):null,u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,j.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(h=>({...h,boundaryMode:"quick"})),children:"Quick estimate"}),(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(h=>({...h,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,j.jsx)("span",{children:"Total fence length (m)"}),(0,j.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:h=>o(E=>({...E,quickLengthM:h.target.value}))})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"fence-boundary__toolbar",children:(0,j.jsxs)("div",{className:"fence-boundary__actions",children:[(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(h=>({...h,boundaryPoints:h.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m({x:0,y:0}),y(null),o(h=>({...h,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(h=>({...h,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,j.jsxs)("div",{className:"fence-boundary",children:[(0,j.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${A} ${Q} ${v} ${S}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:Ve,onPointerMove:B,onPointerUp:ie,onPointerLeave:()=>{y(null),D.current||(T.current=null)},children:[(0,j.jsx)("defs",{children:(0,j.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,j.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,j.jsx)("rect",{x:-jn,y:-Qn,width:jn*3,height:Qn*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,j.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(h=>`${h.x},${h.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((h,E)=>{let N=n.boundaryPoints[E+1],X=Math.hypot(N.x-h.x,N.y-h.y),Z=X?-(N.y-h.y)/X:0,k=X?(N.x-h.x)/X:0,L=(h.x+N.x)/2,P=(h.y+N.y)/2,ce=Z*(L-K.x)+k*(P-K.y)>=0?1:-1,_e=L+Z*Bv*ce,vt=P+k*Bv*ce;return(0,j.jsxs)("g",{children:[(0,j.jsx)("line",{className:"fence-boundary__edge-hit",x1:h.x,y1:h.y,x2:N.x,y2:N.y,onClick:n.boundaryClosed?()=>se(E):void 0}),(0,j.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(E)?" is-excluded":""}`,x1:h.x,y1:h.y,x2:N.x,y2:N.y,pointerEvents:"none"}),(0,j.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(E)?" is-excluded":""}`,x:_e,y:vt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[X.toFixed(2)," m"]})]},`fence-edge-${E}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let h=n.boundaryPoints[n.boundaryPoints.length-1],E=Math.hypot(b.x-h.x,b.y-h.y);if(!E)return null;let N=-(b.y-h.y)/E,X=(b.x-h.x)/E,Z=(h.x+b.x)/2,k=(h.y+b.y)/2;return(0,j.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,j.jsx)("line",{x1:h.x,y1:h.y,x2:b.x,y2:b.y}),(0,j.jsxs)("text",{x:Z+N*.34,y:k+X*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[E.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((h,E)=>E>0&&E===n.boundaryPoints.length-1&&h.x===n.boundaryPoints[0]?.x&&h.y===n.boundaryPoints[0]?.y?null:(0,j.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&E===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:h.x,cy:h.y,r:"0.13",onPointerDown:N=>M(N,E)},`fence-point-${E}`))]}),(0,j.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,j.jsx)("button",{type:"button",onClick:()=>d(h=>Math.max(.5,h-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,j.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,j.jsx)("button",{type:"button",onClick:()=>d(h=>Math.min(1,h+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,j.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(h=>mc(h.boundaryPoints,!1)?h:{...h,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,j.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,j.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,j.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${we.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,j.jsxs)("div",{children:[we.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Sa.heights.map(h=>(0,j.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===h?" is-selected":""}`,onClick:()=>o(E=>({...E,height:h})),children:(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${h}.webp`),alt:""})},h))}),(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(h=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===h.id?" is-selected":""}`,onClick:()=>o(E=>({...E,gravelBoard:h.id})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(h.img),alt:""}),(0,j.jsx)("span",{children:h.label})]},h.id))})]}):null,u==="gate"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(h=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===h.id?" is-selected":""}`,onClick:()=>o(E=>({...E,gateType:h.id,gateWidthM:h.id==="none"?"":String(Sa.gate[h.id].widthDefault)})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(h.img),alt:""}),(0,j.jsx)("span",{children:h.label})]},h.id))}),n.gateType&&n.gateType!=="none"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,j.jsx)("span",{children:"Gate width (m)"}),(0,j.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:h=>o(E=>({...E,gateWidthM:h.target.value}))})]}):null]}):null,u==="posts"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.mounting).map(([h,E])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===h?" is-selected":""}`,onClick:()=>o(N=>({...N,mountingType:h})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:E.blurb})]},h))})]}):null]}),(0,j.jsxs)("div",{className:"truss-estimator__nav",children:[(0,j.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:he,children:"Back"}),(0,j.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:ze,disabled:!ut(),children:[(0,j.jsx)("span",{children:G}),(0,j.jsx)("span",{className:"arrow",children:(0,j.jsx)(Qt,{})})]})]})]})]})})}var fc=Y(Ge()),be=Y(ee()),Lv={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack",byArea:!0},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll",byArea:!0}};function Vd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,fc.useState)("floor"),[n,o]=(0,fc.useState)(""),[l,c]=(0,fc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,d=Lv[r],g=Math.ceil(p/d.coverage),m=[{key:`insulation-${r}`,label:`${d.product} ${d.thickness}`,qty:d.byArea?Math.round(p*100)/100:g,unit:d.byArea?"m2":d.salesUnit,query:d.product,category:"insulation"}],b=Object.entries(Lv);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:b.map(([y,T])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===y?" is-selected":""}`,onClick:()=>i(y),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:T.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[T.product,", ",T.thickness]})]},y))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:y=>o(y.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:y=>c(y.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:d.product}),(0,be.jsxs)("strong",{children:[g," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(m),disabled:p<=0,children:a})]})]})]})})}var Gn=Y(Ge()),$=Y(ee()),sx=10,cx=1.9*.762,ux=1.9*1.524,hc=()=>({height:"",width:""}),gc=e=>Number.parseFloat(e)||0,Hv=({height:e,width:t})=>gc(e)*gc(t);function $d({onBack:e}){let[t,a]=(0,Gn.useState)([hc()]),[r,i]=(0,Gn.useState)([hc()]),[n,o]=(0,Gn.useState)("0"),[l,c]=(0,Gn.useState)("0"),[p,d]=(0,Gn.useState)(1),g=t.reduce((f,u)=>f+Hv(u),0),m=r.reduce((f,u)=>f+Hv(u),0),b=gc(n)*cx+gc(l)*ux,y=Math.max(0,g-m-b),T=y*p/sx,D=(f,u,w,v)=>{f(S=>S.map((R,z)=>z===u?{...R,[w]:v}:R))};return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Paint Calculator"}),(0,$.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,$.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,$.jsx)("span",{}),(0,$.jsx)("span",{children:"Height (m)"}),(0,$.jsx)("span",{children:"Width (m)"}),(0,$.jsx)("span",{})]}),t.map((f,u)=>(0,$.jsxs)("div",{className:"paint-calculator__row",children:[(0,$.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,$.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:w=>D(a,u,"height",w.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,$.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:w=>D(a,u,"width",w.target.value)})]}),t.length>1?(0,$.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(w=>w.filter((v,S)=>S!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,$.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(f=>[...f,hc()]),children:"+ Add another wall"})]}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,$.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,$.jsx)("span",{}),(0,$.jsx)("span",{children:"Height (m)"}),(0,$.jsx)("span",{children:"Width (m)"}),(0,$.jsx)("span",{})]}),r.map((f,u)=>(0,$.jsxs)("div",{className:"paint-calculator__row",children:[(0,$.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,$.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:w=>D(i,u,"height",w.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,$.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:w=>D(i,u,"width",w.target.value)})]}),r.length>1?(0,$.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(w=>w.filter((v,S)=>S!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,$.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(f=>[...f,hc()]),children:"+ Add another area"})]}),(0,$.jsxs)("div",{className:"paint-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Doors"}),(0,$.jsx)("input",{type:"number",min:"0",step:"1",value:n,onChange:f=>o(f.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Double doors"}),(0,$.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:f=>c(f.target.value)})]})]}),(0,$.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,$.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsx)("span",{children:"Number of coats"}),(0,$.jsxs)("select",{value:p,onChange:f=>d(Number(f.target.value)),children:[(0,$.jsx)("option",{value:"1",children:"1 coat"}),(0,$.jsx)("option",{value:"2",children:"2 coats"}),(0,$.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,$.jsxs)("div",{className:"paint-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,$.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Paintable area"}),(0,$.jsxs)("strong",{children:[y.toFixed(2)," m\xB2"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Coverage"}),(0,$.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Paint required"}),(0,$.jsxs)("strong",{children:[T.toFixed(1)," litres"]})]})]}),(0,$.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,$.jsxs)("div",{className:"paint-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var gr=Y(Ge()),te=Y(ee()),bc=e=>Number.parseFloat(e)||0,Zd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,gr.useState)("paving"),[n,o]=(0,gr.useState)("council"),[l,c]=(0,gr.useState)(""),[p,d]=(0,gr.useState)(""),[g,m]=(0,gr.useState)("100"),[b,y]=(0,gr.useState)("50"),[T,D]=(0,gr.useState)(!0),[f,u]=(0,gr.useState)(!0),w=bc(l)*bc(p),v=w,S=w*(bc(g)/1e3),R=w*.04,z=w*(bc(b)/1e3),A=Math.ceil(v/.36),Q=Math.ceil(v/.1),K=Math.ceil(S*1700/800),me=Math.ceil(R*1600/800),Re=Math.ceil(z*1600/800),Oe=r==="paving"?{qty:A,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Re,unit:"bag"},Qe={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],ke=[{key:`surface-${n}`,label:Zd[r].find(re=>re.id===n)?.label??"Surface material",qty:Oe.qty,unit:Oe.unit,query:Qe,category:"landscaping"},...T?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:K,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:me,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Paving and Driveway Calculator"}),(0,te.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,te.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,te.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([re,ue,ye])=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===re?" is-selected":""}`,onClick:()=>{i(re),o(Zd[re][0].id)},children:[(0,te.jsx)("div",{className:"truss-estimator__option-title",children:ue}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:ye})]},re))}),(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Finish"}),(0,te.jsx)("select",{value:n,onChange:re=>o(re.target.value),children:Zd[r].map(re=>(0,te.jsx)("option",{value:re.id,children:re.label},re.id))})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,te.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Length (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:re=>c(re.target.value)})]}),(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Width (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:re=>d(re.target.value)})]})]}),r==="gravel"&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Gravel depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:re=>y(re.target.value)})]}),T&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Sub-base depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:g,onChange:re=>m(re.target.value)})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:T,onChange:re=>D(re.target.checked)}),(0,te.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:f,onChange:re=>u(re.target.checked)}),(0,te.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Surface area"}),(0,te.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,te.jsx)("strong",{children:r==="paving"?`${A} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Re} bulk bags`})]}),T&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"MOT Type 1"}),(0,te.jsxs)("strong",{children:[K," bulk bags"]})]}),f&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Sharp sand"}),(0,te.jsxs)("strong",{children:[me," bulk bags"]})]})]}),(0,te.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,te.jsxs)("div",{className:"materials-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(ke),disabled:w<=0,children:a})]})]})]})})}var sl=Y(Ge()),ae=Y(ee()),px=2.88,jv=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],Qv=()=>({length:"",height:""}),Pd=e=>Number.parseFloat(e)||0;function Jd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,sl.useState)([Qv()]),[n,o]=(0,sl.useState)(""),[l,c]=(0,sl.useState)("standard"),[p,d]=(0,sl.useState)("screws"),g=r.reduce((R,z)=>R+Pd(z.length)*Pd(z.height),0),m=Math.max(0,g-Pd(n)),b=Math.ceil(m/px),y=Math.ceil(m*12),T=Math.ceil(y/1e3),D=Math.ceil(m*1.2),f=Math.ceil(D/90),u=Math.ceil(m/3.5),w=jv.find(R=>R.id===l)?.label??"Standard",v=[{key:"board",label:`${w} plasterboard`,qty:b,unit:"sheet",query:`${w} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:T,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],S=(R,z,A)=>{i(Q=>Q.map((K,me)=>me===R?{...K,[z]:A}:K))};return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Plasterboard and Drylining Calculator"}),(0,ae.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:jv.map(R=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===R.id?" is-selected":""}`,onClick:()=>c(R.id),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:R.label}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:R.blurb})]},R.id))})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([R,z,A])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===R?" is-selected":""}`,onClick:()=>d(R),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:z}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:A})]},R))})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,ae.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,ae.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,ae.jsx)("span",{children:"Surface"}),(0,ae.jsx)("span",{children:"Length (m)"}),(0,ae.jsx)("span",{children:"Height (m)"}),(0,ae.jsx)("span",{})]}),r.map((R,z)=>(0,ae.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,ae.jsxs)("span",{children:["Surface ",z+1]}),(0,ae.jsx)("input",{"aria-label":`Surface ${z+1} length`,type:"number",min:"0",step:"0.01",value:R.length,onChange:A=>S(z,"length",A.target.value)}),(0,ae.jsx)("input",{"aria-label":`Surface ${z+1} height`,type:"number",min:"0",step:"0.01",value:R.height,onChange:A=>S(z,"height",A.target.value)}),r.length>1?(0,ae.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(A=>A.filter((Q,K)=>K!==z)),children:"Remove"}):null]},`surface-${z}`)),(0,ae.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(R=>[...R,Qv()]),children:"+ Add another surface"}),(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,ae.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,ae.jsx)("small",{children:"optional"})]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:R=>o(R.target.value)})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Board area"}),(0,ae.jsxs)("strong",{children:[m.toFixed(2)," m\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,ae.jsx)("strong",{children:b})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,ae.jsx)("strong",{children:p==="screws"?`${y} (${T} boxes)`:`${u} bags`})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Joint tape"}),(0,ae.jsxs)("strong",{children:[D," m (",f," rolls)"]})]})]}),(0,ae.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,ae.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:m<=0,children:a})]})]})]})})}var cl=Y(Ge());var _=Y(ee()),Rt={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},wc=["range","pitchAndDimensions","quantityAndGirders","bracing"],dx={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function mx({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function fx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(d,g,m,b,y=8,T)=>{let D=m-d,f=b-g,u=Math.hypot(D,f)||1,w=-f/u,v=D/u,S=y*.2;return(0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:d,y1:g,x2:m,y2:b,stroke:a,strokeWidth:y+3,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:d,y1:g,x2:m,y2:b,stroke:t,strokeWidth:y,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:d-w*S,y1:g-v*S,x2:m-w*S,y2:b-v*S,stroke:r,strokeWidth:Math.max(1.5,y*.24),strokeLinecap:"round",opacity:"0.9"})]},T)},l=(d,g,m)=>(0,_.jsxs)("g",{children:[(0,_.jsx)("rect",{x:d-7.5,y:g-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,_.jsx)("circle",{cx:d-4,cy:g-2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d+4,cy:g-2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d-4,cy:g+2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d+4,cy:g+2.5,r:"1",fill:n}),(0,_.jsx)("circle",{cx:d,cy:g,r:"1",fill:n})]},m),c=(d,g)=>(0,_.jsx)("rect",{x:d-9,y:"110",width:"18",height:"10",fill:a},g),p=(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,_.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,_.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,_.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function hx({enabled:e}){return(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,_.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,_.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function Gv({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,_.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,_.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Id({onBack:e}){let[t,a]=(0,cl.useState)(0),[r,i]=(0,cl.useState)(dx),[n,o]=(0,cl.useState)(!1),[l,c]=(0,cl.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},g=(()=>{let f=r.range?Rt.ranges[r.range]:Rt.ranges.standard,u=r.pitch??"22.5",w=Rt.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,R=(Number.parseFloat(r.overhangMM)||0)>Rt.overhang.thresholdMM,z=p(),A=z+r.girderCount,Q=Number.parseFloat(r.roofLengthM)||0,K=r.treatment?Rt.treatment[r.treatment]:Rt.treatment.untreated,me=Rt.estimate.ranges[r.range??"standard"],Re=me.supplyAt8m*Math.max(.7,v/8)*w*(1+K.surchargePct)+(R?Rt.overhang.surchargePerTruss:0),Oe=z*Re,Qe=r.girderCount*Re*Rt.estimate.girderMultiplier,ke=r.bracing==="yes"?Q*Rt.estimate.bracingPerMetre:0,we=Oe+Qe+ke+Rt.estimate.delivery,re=Rt.estimate.design+z*me.installPerTruss+r.girderCount*40,ue=we+re,ye=ue*.2;return{range:f,count:z,girderCount:r.girderCount,overhangApplies:R,overhangUnits:A,roofLengthM:Q,treatment:K,trussSupply:Oe,bracingMaterials:ke,delivery:Rt.estimate.delivery,labour:re,subtotal:ue,vat:ye,total:ue+ye}})(),m=()=>{let f=wc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===wc.length-1?"View truss request":"Next",y=()=>{n?o(!1):t===0?e():a(f=>f-1)},T=()=>{m()&&(t===wc.length-1?(c(!1),o(!0)):a(f=>f+1))},D=()=>{let f=wc[t];return f==="range"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(Rt.ranges).map(([u,w])=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(v=>({...v,range:u})),children:[(0,_.jsx)(fx,{type:u}),(0,_.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,_.jsx)("div",{className:"truss-estimator__option-title",children:w.label}),(0,_.jsx)("div",{className:"truss-estimator__option-copy",children:w.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,_.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Span (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(w=>({...w,spanMM:u.target.value}))})]}),(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Overhang (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(w=>({...w,overhangMM:u.target.value}))}),(0,_.jsxs)("small",{children:["Overhangs beyond ",Rt.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Rt.pitches.map(u=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(w=>({...w,pitch:u})),children:[(0,_.jsx)(mx,{degrees:Number.parseFloat(u)}),(0,_.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,_.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,_.jsx)("span",{children:"Roof length (m)"}),(0,_.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(w=>({...w,roofLengthM:u.target.value}))})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:Rt.centresOptions.map(u=>(0,_.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(w=>({...w,centres:u})),children:(0,_.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,_.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,_.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,_.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,_.jsx)("span",{children:r.girderCount}),(0,_.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(w=>({...w,bracing:u.id})),children:[(0,_.jsx)(hx,{enabled:u.id==="yes"}),(0,_.jsx)("span",{children:u.label})]},u.id))}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,_.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,_.jsx)(Gv,{treated:!1}),(0,_.jsx)("span",{children:"Untreated"})]}),(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,_.jsx)(Gv,{treated:!0}),(0,_.jsx)("span",{children:"Treated (+8% cost)"}),(0,_.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"truss-estimator",children:[(0,_.jsxs)("div",{className:"quick-order-hero",children:[(0,_.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,_.jsx)("h1",{children:"Your truss estimate"}),(0,_.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,_.jsxs)("div",{className:"truss-request__heading",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,_.jsxs)("h2",{children:[g.range.label," roof trusses"]})]}),(0,_.jsxs)("strong",{children:[g.count,(0,_.jsx)("span",{children:"trusses"})]})]}),(0,_.jsxs)("div",{className:"truss-request__grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Span"}),(0,_.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Roof length"}),(0,_.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Pitch"}),(0,_.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Centres"}),(0,_.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Overhang"}),(0,_.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Treatment"}),(0,_.jsx)("strong",{children:g.treatment.label})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Girder trusses"}),(0,_.jsx)("strong",{children:g.girderCount||"None"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing pack"}),(0,_.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,_.jsxs)("div",{className:"truss-request__price",children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,_.jsxs)("div",{className:"truss-request__price-grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Truss supply allowance"}),(0,_.jsx)("strong",{children:ot(g.trussSupply)})]}),g.bracingMaterials>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing materials allowance"}),(0,_.jsx)("strong",{children:ot(g.bracingMaterials)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Delivery allowance"}),(0,_.jsx)("strong",{children:ot(g.delivery)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Design and installation labour"}),(0,_.jsx)("strong",{children:ot(g.labour)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,_.jsx)("strong",{children:ot(g.subtotal)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"VAT (20%)"}),(0,_.jsx)("strong",{children:ot(g.vat)})]}),(0,_.jsxs)("div",{className:"truss-request__price-total",children:[(0,_.jsx)("span",{children:"Estimated total"}),(0,_.jsx)("strong",{children:ot(g.total)})]})]}),(0,_.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,_.jsxs)("div",{className:"truss-request__notice",children:[(0,_.jsx)("strong",{children:"Before ordering"}),(0,_.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back to calculator"}),(0,_.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,_.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"truss-estimator",children:[(0,_.jsxs)("div",{className:"quick-order-hero",children:[(0,_.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,_.jsx)("h1",{children:"Roof Truss Calculator"}),(0,_.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card",children:[(0,_.jsx)("div",{className:"truss-estimator__body",children:D()}),(0,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back"}),(0,_.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:T,disabled:!m(),children:[(0,_.jsx)("span",{children:b}),(0,_.jsx)("span",{className:"arrow",children:(0,_.jsx)(Qt,{})})]})]})]})]})})}var Si=Y(Ge()),F=Y(ee()),Vv=e=>Number.parseFloat(e)||0,vc=(e,t)=>Vv(e)*(t==="m"?1:.3048),Yv=()=>({length:"",width:""}),Xv=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function gx({profile:e}){return(0,F.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,F.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,F.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Fd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Si.useState)("total"),[n,o]=(0,Si.useState)("m"),[l,c]=(0,Si.useState)(""),[p,d]=(0,Si.useState)([Yv()]),[g,m]=(0,Si.useState)(""),[b,y]=(0,Si.useState)("chamfered"),T="4.4",D=r==="total"?vc(l,n):p.reduce((S,R)=>S+2*(vc(R.length,n)+vc(R.width,n)),0),f=Math.max(0,D-vc(g,n)),u=Math.ceil(f/Vv(T)),w=[{key:`skirting-${b}`,label:`${Xv.find(S=>S.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],v=(S,R,z)=>{d(A=>A.map((Q,K)=>K===S?{...Q,[R]:z}:Q))};return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"truss-estimator",children:[(0,F.jsxs)("div",{className:"quick-order-hero",children:[(0,F.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,F.jsx)("h1",{children:"Skirting Board Calculator"}),(0,F.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,F.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,F.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,F.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,F.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,F.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,F.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,F.jsx)("span",{children:"Units"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,F.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,F.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:S=>c(S.target.value)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,F.jsx)("span",{children:"Room"}),(0,F.jsxs)("span",{children:["Length (",n,")"]}),(0,F.jsxs)("span",{children:["Width (",n,")"]}),(0,F.jsx)("span",{})]}),p.map((S,R)=>(0,F.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,F.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",R+1]}),(0,F.jsx)("input",{"aria-label":`Room ${R+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:S.length,onChange:z=>v(R,"length",z.target.value)}),(0,F.jsx)("input",{"aria-label":`Room ${R+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:S.width,onChange:z=>v(R,"width",z.target.value)}),p.length>1?(0,F.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>d(z=>z.filter((A,Q)=>Q!==R)),children:"Remove"}):null]},`room-${R}`)),(0,F.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(S=>[...S,Yv()]),children:"+ Add another room"})]}),(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,F.jsx)("small",{children:"optional"})]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:g,onChange:S=>m(S.target.value)})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.4m white-primed MDF boards."}),(0,F.jsx)("div",{className:"architrave-calculator__profiles",children:Xv.map(S=>(0,F.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===S.id?" is-selected":""}`,onClick:()=>y(S.id),children:[(0,F.jsx)(gx,{profile:S.id}),(0,F.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,F.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,F.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,F.jsxs)("label",{className:"truss-estimator__field",children:[(0,F.jsx)("span",{children:"Board length"}),(0,F.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,F.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,F.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Net skirting"}),(0,F.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Board lengths"}),(0,F.jsx)("strong",{children:u})]})]}),(0,F.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,F.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,F.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,F.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(w),disabled:f<=0,children:a})]})]})]})})}var Yn=Y(Ge()),ne=Y(ee()),ul=e=>Number.parseFloat(e)||0;function Wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Yn.useState)("studs"),[n,o]=(0,Yn.useState)(""),[l,c]=(0,Yn.useState)(""),[p,d]=(0,Yn.useState)("600"),[g,m]=(0,Yn.useState)("2.4"),b=n&&l&&p?Math.ceil(ul(l)/(ul(p)/1e3))+1:0,y=b*ul(n),T=ul(g)>0?Math.ceil(y/ul(g)):0,D=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:y,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},w={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)("div",{className:"truss-estimator",children:[(0,ne.jsxs)("div",{className:"quick-order-hero",children:[(0,ne.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ne.jsx)("h1",{children:"Timber Calculator"}),(0,ne.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,ne.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ne.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,ne.jsxs)("p",{className:"truss-estimator__step-sub",children:[w.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,ne.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(v=>(0,ne.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,ne.jsx)("div",{className:"truss-estimator__option-title",children:f[v][0]}),(0,ne.jsx)("div",{className:"truss-estimator__option-copy",children:f[v][1]})]},v))})]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[w.member," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsxs)("span",{children:[w.overall," (m)"]}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Centres (mm)"}),(0,ne.jsxs)("select",{value:p,onChange:v=>d(v.target.value),children:[(0,ne.jsx)("option",{value:"300",children:"300 mm"}),(0,ne.jsx)("option",{value:"400",children:"400 mm"}),(0,ne.jsx)("option",{value:"450",children:"450 mm"}),(0,ne.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Stock length (m)"}),(0,ne.jsxs)("select",{value:g,onChange:v=>m(v.target.value),children:[(0,ne.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,ne.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,ne.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ne.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:w.count}),(0,ne.jsx)("strong",{children:b})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Linear metres"}),(0,ne.jsxs)("strong",{children:[y.toFixed(2)," m"]})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsxs)("span",{children:[g," m lengths"]}),(0,ne.jsx)("strong",{children:T})]})]}),(0,ne.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,ne.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ne.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ne.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(D),disabled:y<=0,children:a})]})]})]})})}var em=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Id},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Xd},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Yd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Od},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:$d},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Fd},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Dd},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Qd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Jd},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:Vd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Wd},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Kd}];var _c=Y(Ge());var je=Y(Ge());var C=Y(ee()),bx=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],tm={wasteFactorEnabled:!0},wx=3e3,$v=null;function yc(e,t){let a=tl(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function vx(e){return e&&e.length>0?e.join(" x "):"-"}function am({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=nc(),o=`${e}~${t.map(k=>`${k.key}|${k.query}|${k.category??""}|${k.qty}`).join("~")}`,l=o!==$v,[c,p]=(0,je.useState)(null),[d,g]=(0,je.useState)([]),[m,b]=(0,je.useState)(l),[y,T]=(0,je.useState)(null),[D,f]=(0,je.useState)("tile"),[u,w]=(0,je.useState)(null),[v,S]=(0,je.useState)(""),[R,z]=(0,je.useState)(null),[A,Q]=(0,je.useState)(""),[K,me]=(0,je.useState)([]),[Re,Oe]=(0,je.useState)(new Set),[Qe,ke]=(0,je.useState)(null),[we,re]=(0,je.useState)(""),[ue,ye]=(0,je.useState)([]),ut=(0,je.useRef)(null),G=(0,je.useRef)(!1),pe=k=>`${e}:${k}`,Me=k=>Kr(k.chosen,{lineId:pe(k.requirement.key),description:k.requirement.label,unit:k.requirement.unit,qty:k.requirement.qty}),St=(0,je.useMemo)(()=>t.map(k=>`${k.key}|${k.query}|${k.category??""}`).join("~"),[t]);(0,je.useEffect)(()=>{let k=!1;return Rv().then(L=>{k||p(L.itemCount>0)}).catch(()=>{k||p(!1)}),()=>{k=!0}},[]),(0,je.useEffect)(()=>{if(!a||!c)return;let k=!1,L;l&&b(!0),T(null);let P=Date.now();return(async()=>{let ce=null;try{ce=(await Av(t,void 0,e)).map(({requirement:vt,candidates:rt})=>({requirement:vt,candidates:rt,chosen:rt[0]??null}))}catch(_e){k||T(_e instanceof Error?_e.message:"Could not load products")}if(!k){if($v=o,l){let _e=wx-(Date.now()-P);_e>0&&await new Promise(vt=>{L=window.setTimeout(vt,_e)})}k||(ce&&(g(ce),!G.current&&n&&(G.current=!0,n.addManyToCart(ce.filter(_e=>_e.chosen).map(Me)))),b(!1))}})(),()=>{k=!0,window.clearTimeout(L)}},[a,c,St]),(0,je.useEffect)(()=>{if(!R)return;let k=A.trim();if(!k){me([]);return}let L=!1,P=window.setTimeout(()=>{fr(k).then(ce=>{L||me(ce)}).catch(()=>{L||me([])})},250);return()=>{L=!0,window.clearTimeout(P)}},[R,A]),(0,je.useEffect)(()=>{if(!Qe)return;let k=we.trim();if(!k){ye([]);return}let L=!1,P=window.setTimeout(()=>{fr(k).then(ce=>{L||ye(ce)}).catch(()=>{L||ye([])})},250);return()=>{L=!0,window.clearTimeout(P)}},[Qe,we]);let Ot=(0,je.useMemo)(()=>{let k=v.trim().toLowerCase(),L=k?d.filter(P=>P.requirement.label.toLowerCase().includes(k)||(P.chosen?.description??"").toLowerCase().includes(k)||(P.chosen?.product_id??"").toLowerCase().includes(k)):d;return u?[...L].sort((P,ce)=>{let _e=P.requirement.label.localeCompare(ce.requirement.label);return u==="asc"?_e:-_e}):L},[d,v,u]),Ut=Ot.filter(k=>k.chosen),Ze=Ot.filter(k=>!k.chosen),Ne=d.filter(k=>k.chosen),ve=Ne.filter(k=>k.chosen?.price==null).length,Ve=Ne.reduce((k,L)=>k+(Ft(Me(L),tm).lineTotal??0),0);if((0,je.useEffect)(()=>{i?.(Ve)},[Ve,i]),!a||c===!1)return null;let M=n?Ne.filter(k=>n.cart[pe(k.requirement.key)]).length:0,B=Qe?d.find(k=>k.requirement.key===Qe)??null:null,se=we.trim()?ue:B?.candidates??[],he=k=>{let L=R===k.requirement.key;z(L?null:k.requirement.key),Q(L?"":k.requirement.query)},ze=(k,L)=>{let P=d.find(ce=>ce.requirement.key===k);g(ce=>ce.map(_e=>_e.requirement.key===k?{..._e,chosen:L}:_e)),n&&P&&n.cart[pe(k)]&&n.addToCart(Me({...P,chosen:L})),z(null),Q("")},Ke=k=>{g(L=>L.map(P=>P.requirement.key===k?{...P,chosen:null}:P)),n?.cart[pe(k)]&&n.removeFromCart(pe(k))},h=k=>{ke(k.requirement.key),re(""),ye([])},E=()=>{ke(null),re(""),ye([])},N=k=>{if(!n)return;let L=pe(k.requirement.key);n.cart[L]?n.removeFromCart(L):n.addToCart(Me(k))},X=k=>{Oe(L=>{let P=new Set(L);return P.has(k)?P.delete(k):P.add(k),P})},Z=k=>{let L=K.length>0?K:k.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:A,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:P=>Q(P.target.value),"aria-label":`Search a product for ${k.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[L.map(P=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${P.product_id===k.chosen?.product_id?" is-selected":""}`,onClick:()=>ze(k.requirement.key,P),children:[(0,C.jsx)("span",{children:P.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${ot(P.price)}`]})]},P.product_id)),L.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!m&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!B&&(0,C.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[ve>0&&(0,C.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,C.jsx)("strong",{children:ve})," need pricing"]}),(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:k=>S(k.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="tile"?" is-active":""}`,"aria-pressed":D==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${D==="list"?" is-active":""}`,"aria-pressed":D==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:ut,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:bx.map(k=>{let L=u===k.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{w(L?null:k.dir),ut.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),k.label]},k.dir)})})]})]})]})]}),B&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:E,children:[(0,C.jsx)(Zr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:we,onChange:k=>re(k.target.value),"aria-label":`Search a product for ${B.requirement.label}`})}),B.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ke(B.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(B.chosen?.description||B.requirement.label,B.chosen?.product_id,B.chosen?.pdp_photo_url),alt:""})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:B.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[vi(B.requirement.qty)," ",ka(B.requirement.unit,B.requirement.qty)]}),B.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:B.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[B.chosen.product_id,B.chosen.price!=null?` \xB7 ${yc(B.chosen.price,B.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[pe(B.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(B),disabled:!B.chosen||!n,children:n?.cart[pe(B.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),se.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:se.map(k=>{let L=k.product_id===B.chosen?.product_id;return(0,C.jsxs)("tr",{className:L?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:k.description}),(0,C.jsx)("div",{className:"results-row-meta",children:k.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:vx(k.measurements_mm)})}),(0,C.jsx)("td",{children:k.price!=null?yc(k.price,k.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:L?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:L,onChange:()=>{L?Ke(B.requirement.key):ze(B.requirement.key,k)},"aria-label":L?`${k.description} selected`:`Use ${k.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},k.product_id)})})]})]}),!B&&m&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(dr,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!B&&y&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:y}),!B&&!m&&!y&&Ot.length===0&&d.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!B&&!m&&!y&&D==="tile"&&Ut.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:Ut.map(k=>{let{requirement:L,chosen:P}=k,ce=P?Ft(Me(k),tm):null,_e=n?!!n.cart[pe(L.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>h(k),"aria-label":`Review match for ${L.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(P?.description||L.label,P?.product_id,P?.pdp_photo_url),alt:""})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[P?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:P.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:P.product_id}),P.price!=null?(0,C.jsx)("span",{children:yc(P.price,P.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:L.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[vi(L.qty)," ",ka(L.unit,L.qty)]}),ce?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",ce.requiredSellUnits," ",ce.sellUnit,ce.lineTotal!=null?` \xB7 ${ot(ce.lineTotal)}`:""]}):P?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>h(k),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(k),disabled:!P||!n,children:_e?"\u2713 Added":"+ Add"})]})]},L.key)})}),!B&&!m&&!y&&D==="list"&&Ut.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:Ut.map(k=>{let{requirement:L,chosen:P}=k,ce=P?Ft(Me(k),tm):null,_e=n?!!n.cart[pe(L.key)]:!1,vt=Re.has(L.key);return(0,C.jsxs)(je.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>X(L.key),"aria-expanded":vt,"aria-label":vt?"Collapse product options":"Expand product options",children:vt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:L.label}),ce?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",ce.requiredSellUnits," ",ce.sellUnit,ce.lineTotal!=null?` \xB7 ${ot(ce.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:vi(L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:ka(L.unit,L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:P?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:P.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${yc(P.price,P.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>N(k),disabled:!P||!n,children:_e?"\u2713 Added":"+ Add"})})]}),vt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:R===L.key?Z(k):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[k.candidates.map(rt=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${rt.product_id===P?.product_id?" is-selected":""}`,onClick:()=>ze(L.key,rt),children:[(0,C.jsx)("span",{children:rt.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[rt.product_id,rt.price!=null&&` \xB7 ${ot(rt.price)}`]})]},rt.product_id)),k.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>he(k),children:"Search the catalogue"})]})})})]},L.key)})})]})}),!B&&!m&&!y&&Ze.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:Ze.map(k=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>h(k),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:k.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[vi(k.requirement.qty)," ",ka(k.requirement.unit,k.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},k.requirement.key))})]}),!m&&!y&&d.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!B&&!m&&!y&&(r||M>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),M>0&&n&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",M,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=Y(ee());function rm({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,_c.useState)(0),o=(0,_c.useCallback)(l=>n(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:ot(i)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(am,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var im=Y(Ge());var Wt=Y(ee()),yx=1500;function Zv(e){let{addManyToCart:t,clearCart:a,openBasket:r}=Dn(),[i,n]=(0,im.useState)(!1),[o,l]=(0,im.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,d)=>{let g=Date.now();n(!0),l(null);try{let m=await Promise.all(p.filter(y=>y.qty>0).map(async y=>{let T=(await fr(y.search)).find(D=>D.product_id===y.productId);if(!T)throw new Error("A selected product is no longer available in this catalogue.");return Kr(T,{lineId:`${e}:${y.key}`,description:T.description,unit:Ld(y.unit??"each",T),qty:y.qty,calculatorWasteIncluded:d})})),b=yx-(Date.now()-g);b>0&&await new Promise(y=>window.setTimeout(y,b)),a(),t(m),r()}catch(m){l(m instanceof Error?m.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function Kv({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(dr,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Ae=Y(ee());function xc(e){let[t,a]=(0,Xa.useState)(!1);return(0,Ae.jsx)(ic,{onOpenBasket:()=>a(!0),children:(0,Ae.jsx)(_x,{...e,showBasket:t,onShowBasket:a})})}function _x({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,Xa.useState)(null),[l,c]=(0,Xa.useState)(null),p=em.find(A=>A.id===n),{cart:d,updateCartQty:g,updateCartSellUnits:m,updateCartConversions:b,removeFromCart:y,clearCart:T}=Dn(),{adding:D,basketError:f,addToBasket:u}=Zv(p?.title??"calculator"),w=(0,Xa.useRef)(null),v=Xs("estimating-tools",w);(0,Xa.useEffect)(()=>{v("viewed")},[v]);let S=r?"basket":D?"adding":l?"review":n??"list",R=(0,Xa.useRef)(S);(0,Xa.useEffect)(()=>{R.current!==S&&(R.current=S,window.scrollTo(0,0))},[S]);let z=A=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:A.length});let Q=Tv(p.id,A);Q?u(Q,A[0]?.calculatorWasteIncluded??!1):c(A)};return(0,Ae.jsx)(Jo.Provider,{value:v,children:(0,Ae.jsx)("div",{ref:w,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:jt().theme,children:(0,Ae.jsx)("main",{className:"main-content",children:r?(0,Ae.jsx)(ll,{cart:d,onUpdateQty:g,onUpdateSellUnits:m,onResolveConversions:b,onRemove:y,onBack:()=>i(!1),onStartNewQuote:()=>{T(),o(null),c(null),i(!1)},internal:a}):D&&p?(0,Ae.jsx)(Kv,{toolTitle:p.title}):p?(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("div",{hidden:l!==null,children:(0,Ae.jsx)(p.Component,{onBack:()=>o(null),onReview:z})}),f&&(0,Ae.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,Ae.jsx)(rm,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Ae.jsx)(Ae.Fragment,{children:(0,Ae.jsxs)("div",{className:"quick-order-card",children:[(0,Ae.jsxs)("div",{className:"quick-order-hero",children:[(0,Ae.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Ae.jsx)("h1",{children:"Estimating Tools"}),(0,Ae.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Ae.jsxs)("div",{className:"quick-order-alt",children:[(0,Ae.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Ae.jsx)("div",{className:"estimator-tools-grid",children:em.map(A=>(0,Ae.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:A.id}),o(A.id),c(null)},children:[(0,Ae.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Ae.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(A.imageUrl),alt:""})}),(0,Ae.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Ae.jsx)("span",{className:"estimator-tool-card__title",children:A.title}),(0,Ae.jsx)("span",{className:"estimator-tool-card__desc",children:A.desc})]})]},A.id))})]})]})})})})})}var kc=Y(ee());function nm({config:e,children:t}){return cw(e),(0,kc.jsx)(kc.Fragment,{children:t})}var om=Y(ee()),xx="https://api.metronlabs.ai",kx=["client","api-key","api-url","theme","hide-header","analytics"],Nx=["all","events-only","none"];function Jv(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.58",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
6994
6994
  :host > div { all: initial; display: block; }
6995
- ${aw}`,this.shadowRoot.replaceChildren(n,i),this.root=(0,jv.createRoot)(i)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let i=this.getAttribute("client")??void 0,n=this.getAttribute("api-key")??void 0;(!i||!n)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||px,client:i,apiKey:n,theme:hx(e,this.getAttribute("theme")),analytics:fx(this.getAttribute("analytics"))};this.root.render((0,em.jsx)(Wd,{config:o,children:(0,em.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=dx,a))}function fx(e){return mx.find(t=>t===e)??"all"}function hx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}Qv("metron-labs-quick-quote",ac);Qv("metron-labs-estimating-tools",wc);
6995
+ ${sw}`,this.shadowRoot.replaceChildren(n,i),this.root=(0,Pv.createRoot)(i)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let i=this.getAttribute("client")??void 0,n=this.getAttribute("api-key")??void 0;(!i||!n)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||xx,client:i,apiKey:n,theme:Cx(e,this.getAttribute("theme")),analytics:Sx(this.getAttribute("analytics"))};this.root.render((0,om.jsx)(nm,{config:o,children:(0,om.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=kx,a))}function Sx(e){return Nx.find(t=>t===e)??"all"}function Cx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}Jv("metron-labs-quick-quote",oc);Jv("metron-labs-estimating-tools",xc);
6996
6996
  /*! Bundled license information:
6997
6997
 
6998
6998
  scheduler/cjs/scheduler.production.js: