PageSourceSearch

https://www.surania.com/cdn/shopifycloud/checkout-web/assets/c1/01f1d1bd.DypWlcT3.js

js surania.com collected 2026-10-02 11:39:26 UTC 10,475 bytes, 1 lines download raw bytes

1import{x as e,m as t,a0 as a,O as n,z as r,t as l,l as i,u as o,v as s,T as c,C as u,w as d}from"./2c1ab0fe.GMbxnz74.js";import{cT as h,H as m,P as p,L as v,c as b,B as f,a3 as g,F as y,o as _,W as w,I as x,c0 as k,i as T,e as S,a2 as I,J as A,cU as V,b as j,ap as q,am as E,an as z,ao as P,aj as N,ag as C,ak as D,cV as R}from"./164ad2e3.BbIvMjRY.js";import{S as $}from"./79974aab.hHH-4idQ.js";import{T as U,S as L,J as M,bF as H}from"./4c290a1e.C6TDJ9Fn.js";import{u as W}from"./5fda1420.KYpufQ--.js";import{u as B,S as F}from"./ca5e9c49.BT49yYQL.js";import{S as G}from"./app.CepNJbvh.js";import{d as O}from"./b8733b27.B0VmlfYu.js";import"./9f047e05.CCJUgz_L.js";import"./0a7dffce.DfUtZWCu.js";import"./60a453ce.CkhHeRBc.js";import"./21cc90a2.DAzJmttM.js";import"./bb728e1c.iawBHR84.js";function J(){const[a,n]=e("undefined"==typeof document?"visible":document.visibilityState);return t(()=>{const e=()=>n(document.visibilityState);return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}},[]),a}function Q(e){return!1===e.available}const Z={id:"186ea50e2b37f36013ff760cddcee64b27d2785edc79d3078d8bb95e4186410b",type:"query",name:"ThrottlePoll",source:"query ThrottlePoll($token:String!,$variantIdsV2:[Int!]){poll(token:$token,variantIdsV2:$variantIdsV2){...on PollContinue{token pollAfter queueEtaSeconds productVariantAvailabilityV2{available id __typename}__typename}...on PollComplete{token __typename}__typename}}"};class K extends G{constructor(){super(...arguments),this.name="ThrottleError",this.defaultGroupingHash="ThrottleError::Exiting::Status"}}class X extends G{constructor(){super(...arguments),this.name="UnactionableThrottleError",this.unactionable=!0}}function Y(e){return parseInt(M(e),10)}function ee({inventoryStatus:e}){const{i18n:t,shop:{hasStorefront:a},url:n,checkout:{configuration:r}}=L(),l="empty"===e?t.translate("stock.empty_cart_label"):t.translate("throttle.inventory.sold_out.heading"),i="empty"===e?t.translate("stock.return_to_store_label"):t.translate("throttle.inventory.sold_out.link");return o(b,{gap:"small-200",alignItems:"center",padding:"large-300",children:[o(m,{level:1,children:l}),a&&"unavailable"===e&&o(p,{size:"large",textAlign:"center",children:t.translate("throttle.inventory.sold_out.storefront_body")}),a&&r.allowRedirectToStorefront&&o(p,{textAlign:"center",children:o(v,{href:n.storefront(),children:i})}),!a&&"unavailable"===e&&o(p,{size:"large",textAlign:"center",children:t.translate("throttle.inventory.sold_out.no_storefront_body")})]})}function te({heading:e,details:t,children:a}){return o(g,{borderRadius:"base",border:"base",children:[o(f,{padding:"large-200",accessibilityRole:"header",children:o(b,{direction:"inline",gap:"small-200",alignItems:"baseline",children:[o(m,{level:2,children:e}),t?o(p,{color:"subdued",type:"small",children:t}):null]})}),o(f,{borderWidth:"base none none none",padding:"large-200",children:a})]})}function ae(){const{i18n:e}=L();return o(w,{tone:"warning",errorType:y.InventoryError,children:o(p,{type:"small",children:o(_,{type:"strong",children:e.translate("throttle.inventory.partial_inventory_banner")})})})}function ne({barCount:e=7}){const t={"--ProgressBar-width":13*e+"px"},a=[];for(let n=0;n<e;n++)a.push(o("div",{className:s("zetxR")},n));return o("div",{className:"NMORO",style:t,children:a})}function re(){const{checkout:e,i18n:t}=L(),a=e.negotiator.throttleState.value,n="queued"===a.status?a.queueEtaSeconds:0,r=c(()=>null==n?t.translate("throttle.estimated_wait_time.calculating"):n<60?t.translate("throttle.estimated_wait_time.less_than_one"):t.translate("throttle.estimated_wait_time",{count:Math.round(n/60)}),[n,t]);return o(b,{alignItems:"center",gap:"large-200",padding:"large-200",children:[o(ne,{}),o(b,{gap:"small-200",alignItems:"center",children:[o(m,{level:1,textAlign:"center",children:t.translate("throttle.line_to_check_out")}),o(p,{size:"base",children:r})]})]})}function le(){const{i18n:e}=L(),t=e.translate("throttle.merchandise.available").trim();return 0===t.length?null:o(p,{children:o(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[o(x,{size:"small-200",tone:"success",type:"check"}),o(_,{type:"strong",tone:"success",size:"small",children:o("span",{className:"broxv",children:t})})]})})}function ie(){const{i18n:e}=L(),t=e.translate("throttle.merchandise.sold_out").trim();return 0===t.length?null:o(k,{children:o(b,{direction:"inline",gap:"small-400",alignItems:"center",children:[o(x,{size:"small-200",tone:"critical",type:"disabled"}),o(_,{size:"small",children:o("span",{className:"hG8Tu",children:t})})]})})}function oe(){const{progress:s}=T(),c=r(function(){const[r,l]=e(null),o=h(),s=a(),[c,u]=e(),{value:d}=U().merchandiseLines,{checkout:{negotiator:m},graphql:{throttleGraphql:p},observability:v}=L(),b=m.throttleState.value;if(t(()=>{l(e=>e??new Date)},[]),function(e,a){const n=i(e);
1n.current=e;const r=J();t(()=>{if(!a)return;const e=Math.max(a-Date.now(),0);if(0!==e){const t=setTimeout(n.current,e);return()=>clearTimeout(t)}n.current()},[a,r])}(async()=>{if("queued"===b.status)try{const e=d?d.lines.filter(e=>e.variantId).map(e=>Y(e.variantId)):[],{data:t,error:a}=await p.staticQuery(Z,{cache:!1,variables:{token:b.token,variantIdsV2:e}});if(!o.current)return;if(a)throw a;if(!t)throw new K("Throttle poll did not return data",{groupingHash:"ThrottleError::PollMissingReturnData"});const n=function({poll:e},t){if("PollContinue"===e.__typename)return{status:"queued",pollAfter:new Date(e.pollAfter).getTime(),token:e.token,queueEtaSeconds:e.queueEtaSeconds??void 0,productVariantAvailabilityV2:e.productVariantAvailabilityV2,pollUrl:t.pollUrl};if("PollComplete"===e.__typename)return{status:"complete",token:e.token,productVariantAvailabilityV2:t.productVariantAvailabilityV2};throw new K("unable to handle Throttle type",{groupingHash:"ThrottleError::ThrottleType"})}(t,b);"queued"===n.status&&b?.pollAfter===n.pollAfter&&(n.pollAfter=Date.now()+1e3),m.setThrottle(n),l(new Date),s.reset()}catch(e){const t=s.next(),a=t.done,r=O(e),l=e instanceof n?e.response.status:void 0;if(a)return u(new(r.actionable?K:X)("Throttle exited on maximum retries",{cause:e})),void v.counter({name:"throttle_exited_on_maximum_retries",value:1});if(l&&l<500)return void u(new(r.actionable?K:X)(`Throttle exiting on ${l} status`,{cause:e}));m.setThrottle({...b,pollAfter:Date.now()+t.value})}},"queued"===b.status?b.pollAfter:void 0),c)throw c;return{throttle:b,lastUpdated:r}}()),{i18n:m,shop:v,url:y,observability:w,embed:x,router:k}=L(),M=J(),G=function(){const e=L().checkout.negotiator.throttleState.value,t=r(e),a=U().merchandiseLines;return l(()=>{const e=t.value;if("inactive"===e.status||"loading"===e.status||!a.value)return[];const n=new Map(e.productVariantAvailabilityV2.map(({id:e,available:t})=>[e,t]));return a.value.lines.filter(e=>e.variantId).map(e=>({...e,available:n.get(Y(e.variantId))}))})}(),ne=l(()=>G.value.length>0?G.value:null),le=h(),ie=l(()=>c.value.throttle.status),oe=l(()=>c.value.lastUpdated),ce=l(()=>"complete"===ie.value||"queued"===ie.value?function(e){return 0===e.length?"empty":e.every(Q)?"unavailable":e.some(Q)?"partially_available":"available"}(G.value):null),ue=i(s),{currentPage:de}=S().value;ue.current=s;const he=i(!1);u(()=>{if(he.current)return;const e=ce.value;if(!e)return;const t=G.value;w.counter({name:"throttle_rendered",value:1,attributes:{throttle_status:ie.value,inventory_status:e,merchandise_available:t.filter(({available:e})=>e).length,merchandise_unavailable:t.filter(({available:e})=>!e).length,has_storefront:v.hasStorefront}}),he.current=!0});const me=i(!1);t(()=>{me.current||(me.current=!0,H(x,"throttle"))},[x]),W("complete"===ie.value&&"hidden"===M?m.translate("throttle.time_to_checkout_title",{shopName:v.name}):"loading"===ie.value?m.translate("general.loading_title",{shopName:v.name}):m.translate("general.full_title",{pageTitle:m.translate("throttle.title"),shopName:v.name}));const pe=de?.route,ve=i(!1);t(()=>{!function e(){ue.current("throttle-run",t=>{"throttled"===t.status&&le.current?(ve.current=!1,e()):function(e){return"fetch_failed"===e.status&&e.reason.endsWith("status: 429")&&!ve.current&&le.current}(t)?(ve.current=!0,e()):"error"!==t.status&&"fetch_failed"!==t.status||(pe?k.navigate(pe,{replace:!0}):window.location.assign(y.cart()))})}()},[ue,le,y,pe,k]),B({stage:F.Usable,id:"Throttle"});const{header:{logo:be}}=I();return"inactive"===ie.value?null:o(A,{placeItems:"center",minBlockSize:"100vh",background:"base",children:o(f,{maxInlineSize:"450px",padding:"base",children:o($,{target:"card",children:o(g,{accessibilityLabel:m.translate("throttle.title"),children:o(b,{gap:"base",children:[be&&o(A,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"center",justifyItems:"center",children:o(V,{width:be.maxWidth})}),o(d,{when:()=>"empty"===ce.value,fallback:o(d,{when:()=>"unavailable"===ce.value,fallback:o(re,{}),children:o(ee,{inventoryStatus:"unavailable"})}),children:o(ee,{inventoryStatus:"empty"})}),o(d,{when:ne,children:e=>o(te,{heading:m.translate("throttle.cart_summary_heading"),details:oe.value?m.translate("throttle.last_checked",{time:m.formatDate(oe.value,{hour:"numeric",minute:"numeric",timeZoneName:"short"})}):void 0,children:[o(d,{when:()=>"partially_available"===ce.value,children:[o(ae,{}),o(j,{blockSize:"large-200"})]}),o(q,{children:[o(E,{hidden:!0,children:[o(z,{hidden:!0,children:m.translate("order_summary.product_image_label")}),o(z,{hidden:!0,children:m.translate("order_summary.description_label")})]}),o(P,{children:e.map(({digest:e,image:t,available:a,title:n,subtitle:r,quantity:l,properties:i})=>o(N,{children:[o(C,{children:o(D,{src:t?.one,srcSet:t?`${t.one} 1x, ${t.two} 2x, ${t.four} 4x`:void 0,alt:t?.altText,totalItems:l})}),o(C,{primary:!0,children:[o(p,{children:o(_,{type:"strong",children:n})}),r?o(p,{color:"subdued",children:r}):null,i?o(R,{properties:i}):null,null==a?null:o(se,{available:a})]})]},e))})]})]})}),o(d,{when:()=>"empty"!==ce.value&&"unavailable"!==ce.value,children:o(f,{padding:"large-200 none",children:o(b,{alignItems:"center",gap:"small-200",accessibilityRole:"footer",children:[o(p,{color:"subdued",textAlign:"center",children:m.translate("throttle.footer.heading")}),o(p,{color:"subdued",textAlign:"center",children:m.translate("throttle.footer.body")})]})})})]})})})})})}function se({available:e}){return o(e?le:ie,{})}export{oe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.