PageSourceSearch

https://satana.dk/cdn/shopifycloud/checkout-web/assets/c1/01f1d1bd.BNXejKS_.js

js satana.dk collected 2026-10-08 09:33:08 UTC 10,781 bytes, 1 lines download raw bytes

1import{z as e,h as t,aa as a,R as n,s as r,k as l,u as i,m as o,T as s,p as c,g as u,w as d,L as h}from"./2c1ab0fe.B2yRRyAW.js";import{c as m,n as p,v,z as b,bb as f,I as g}from"./4b4bc88f.JFrEI7LU.js";import{d4 as y,H as _,f as w,L as k,S as x,b as S,i as T,aa as A,j as I,a9 as j,a1 as q,bG as V,v as z,k as E,l as N,ab as L,d5 as P,d as R,aB as C,ay as D,az as $,aA as U,av as M,at as B,aw as G,d6 as H}from"./164ad2e3.-hfWY9cN.js";import{S as W}from"./79974aab.Du4uYIZv.js";import{u as O}from"./5fda1420.BwaRlU2R.js";import{u as F,S as Q}from"./71ae3d5c.BTocP6cf.js";import{S as Z}from"./app.C_W8kcQ4.js";import{d as J}from"./b8733b27.B-ZhbwZE.js";import"./d0bb51ec.CiN57OqX.js";import"./f67abd2c.Boj0gJpa.js";import"./60a453ce.aSs2kW8G.js";import"./e12db40c.ZpKYxNRe.js";import"./9dba8418.BqWu-Ch9.js";import"./2495faa4.B5RDSEV2.js";function K(){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 X(e){return!1===e.available}const Y={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 ee extends Z{constructor(){super(...arguments),this.name="ThrottleError",this.defaultGroupingHash="ThrottleError::Exiting::Status"}}class te extends Z{constructor(){super(...arguments),this.name="UnactionableThrottleError",this.unactionable=!0}}function ae(){const[r,l]=e(null),i=y(),o=a(),[s,c]=e(),{checkout:{negotiator:u},graphql:{throttleGraphql:d},observability:h}=m(),{value:v}=u.current.fields.merchandiseLines,b=u.throttleState.value;if(t(()=>{l(e=>e??new Date)},[]),function(e,a){const r=p(async()=>{if("queued"===b.status)try{const e=v?v.lines.filter(e=>e.variantId).map(e=>ne(e.variantId)):[],{data:t,error:a}=await d.staticQuery(Y,{cache:!1,variables:{token:b.token,variantIdsV2:e}});if(!i.current)return;if(a)throw a;if(!t)throw new ee("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 ee("unable to handle Throttle type",{groupingHash:"ThrottleError::ThrottleType"})}(t,b);"queued"===n.status&&b?.pollAfter===n.pollAfter&&(n.pollAfter=Date.now()+1e3),u.setThrottle(n),l(new Date),o.reset()}catch(e){const t=o.next(),a=t.done,r=J(e),l=e instanceof n?e.response.status:void 0;if(a)return c(new(r.actionable?ee:te)("Throttle exited on maximum retries",{cause:e})),void h.counter({name:"throttle_exited_on_maximum_retries",value:1});if(l&&l<500)return void c(new(r.actionable?ee:te)(`Throttle exiting on ${l} status`,{cause:e}));u.setThrottle({...b,pollAfter:Date.now()+t.value})}}),s=K();t(()=>{if(!a)return;const e=Math.max(a-Date.now(),0);if(0!==e){const t=setTimeout(r.current,e);return()=>clearTimeout(t)}r.current()},[a,r,s])}(0,"queued"===b.status?b.pollAfter:void 0),s)throw s;return{throttle:b,lastUpdated:r}}function ne(e){return parseInt(v(e),10)}function re({inventoryStatus:e}){const{i18n:t,shop:{hasStorefront:a,partnerStorefrontUrl:n},url:r,checkout:{configuration:l}}=m(),o="empty"===e?t.translate("stock.empty_cart_label"):t.translate("throttle.inventory.sold_out.heading"),s="empty"===e?t.translate("stock.return_to_store_label"):t.translate("throttle.inventory.sold_out.link");return i(x,{gap:"small-200",alignItems:"center",padding:"large-300",children:[i(_,{level:1,children:o}),a&&"unavailable"===e&&i(w,{size:"large",textAlign:"center",children:t.translate("throttle.inventory.sold_out.storefront_body")}),a&&l.allowRedirectToStorefront&&i(w,{textAlign:"center",children:i(k,{href:n??r.storefront(),children:s})}),!a&&"unavailable"===e&&i(w,{size:"large",textAlign:"center",children:t.translate("throttle.inventory.sold_out.no_storefront_body")})]})}function le({heading:e,details:t,children:a}){return i(T,{borderRadius:"base",border:"base",children:[i(S,{padding:"large-200",accessibilityRole:"header",children:i(x,{direction:"inline",gap:"small-200",alignItems:"baseline",children:[i(_,{level:2,children:e}),t?i(w,{color:"subdued",type:"small",children:t}):null]})}),i(S,{borderWidth:"base none none none",padding:"large-200",children:a})]})}function ie(){const{i18n:e}=m();return i(j,{tone:"warning",errorType:A.InventoryError,children:i(w,{type:"small",children:i(I,{type:"strong",children:e.translate("throttle.inventory.partial_inventory_banner")})})})}function oe({barCount:e=7}){const t={"--ProgressBar-width":13*e+"px"},a=[];for(let n=0;n<e;n++)a.push(i("div",{className:o("zetxR")},n));return i("div",{className:"NMORO",style:t,children:a})}function se(){const{checkout:e,i18n:t}=m(),a=e.negotiator.throttleState.value,n="queued"===a.status?a.queueEtaSeconds:0,r=s(()=>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 i(x,{alignItems:"center",gap:"large-200",padding:"large-200",children:[i(oe,{}),i(x,{gap:"small-200",alignItems:"center",children:[i(_,{level:1,textAlign:"center",children:t.translate("throttle.line_to_check_out")}),i(w,{size:"base",children:r})]})]})}function ce(){const{i18n:e}=m(),t=e.translate("throttle.merchandise.available").trim();return 0===t.length?null:i(w,{children:i(x,{direction:"inline",gap:"small-400",alignItems:"center",children:[i(q,{size:"small-200",tone:"success",type:"check"}
1),i(I,{type:"strong",tone:"success",size:"small",children:i("span",{className:"broxv",children:t})})]})})}function ue(){const{i18n:e}=m(),t=e.translate("throttle.merchandise.sold_out").trim();return 0===t.length?null:i(V,{children:i(x,{direction:"inline",gap:"small-400",alignItems:"center",children:[i(q,{size:"small-200",tone:"critical",type:"disabled"}),i(I,{size:"small",children:i("span",{className:"hG8Tu",children:t})})]})})}function de(){const{progress:e}=z(),a=r(ae()),{i18n:n,shop:o,url:s,observability:p,embed:v,router:_}=m(),k=K(),A=function(){const{checkout:{negotiator:e}}=m(),t=e.throttleState.value,a=r(t),n=e.current.fields.merchandiseLines;return l(()=>{const e=a.value;if("inactive"===e.status||"loading"===e.status||!n.value)return[];const t=new Map(e.productVariantAvailabilityV2.map(({id:e,available:t})=>[e,t]));return n.value.lines.filter(e=>e.variantId).map(e=>({...e,available:t.get(ne(e.variantId))}))})}(),j=l(()=>A.value.length>0?A.value:null),q=y(),V=l(()=>a.value.throttle.status),Z=l(()=>"inactive"!==V.value);c(()=>{if(!Z.value||!g(v?.embedder))return;const e=h(()=>v?.presentation?.acquire());return()=>h(()=>e?.())});const J=l(()=>a.value.lastUpdated),Y=l(()=>"complete"===V.value||"queued"===V.value?function(e){return 0===e.length?"empty":e.every(X)?"unavailable":e.some(X)?"partially_available":"available"}(A.value):null),ee=u(e),{currentPage:te}=E().value;ee.current=e;const oe=u(!1);c(()=>{if(oe.current)return;const e=Y.value;if(!e)return;const t=A.value;p.counter({name:"throttle_rendered",value:1,attributes:{throttle_status:V.value,inventory_status:e,merchandise_available:t.filter(({available:e})=>e).length,merchandise_unavailable:t.filter(({available:e})=>!e).length,has_storefront:o.hasStorefront}}),oe.current=!0});const ce=u(!1);t(()=>{ce.current||(ce.current=!0,f(v,"throttle"))},[v]),O("complete"===V.value&&"hidden"===k?n.translate("throttle.time_to_checkout_title",{shopName:o.name}):"loading"===V.value?n.translate("general.loading_title",{shopName:o.name}):n.translate("general.full_title",{pageTitle:n.translate("throttle.title"),shopName:o.name}));const ue=te?.route,de=u(!1);t(()=>{!function e(){ee.current("throttle-run",t=>{"throttled"===t.status&&q.current?(de.current=!1,e()):function(e){return"fetch_failed"===e.status&&e.reason.endsWith("status: 429")&&!de.current&&q.current}(t)?(de.current=!0,e()):"error"!==t.status&&"fetch_failed"!==t.status||(ue?_.navigate(ue,{replace:!0}):window.location.assign(s.cart()))})}()},[ee,q,s,ue,_]),F({stage:Q.Usable,id:"Throttle"});const{header:{logo:me}}=N();return"inactive"===V.value?null:i("div",{className:b({colorScheme:"scheme1",colorLayer:"base"}),children:i(L,{placeItems:"center",minBlockSize:"100vh",background:"base",children:i(S,{maxInlineSize:"450px",padding:"base",children:i(W,{target:"card",children:i(T,{accessibilityLabel:n.translate("throttle.title"),children:i(x,{gap:"base",children:[me&&i(L,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"center",justifyItems:"center",children:i(P,{width:me.maxWidth})}),i(d,{when:()=>"empty"===Y.value,fallback:i(d,{when:()=>"unavailable"===Y.value,fallback:i(se,{}),children:i(re,{inventoryStatus:"unavailable"})}),children:i(re,{inventoryStatus:"empty"})}),i(d,{when:j,children:e=>i(le,{heading:n.translate("throttle.cart_summary_heading"),details:J.value?n.translate("throttle.last_checked",{time:n.formatDate(J.value,{hour:"numeric",minute:"numeric",timeZoneName:"short"})}):void 0,children:[i(d,{when:()=>"partially_available"===Y.value,children:[i(ie,{}),i(R,{blockSize:"large-200"})]}),i(C,{children:[i(D,{hidden:!0,children:[i($,{hidden:!0,children:n.translate("order_summary.product_image_label")}),i($,{hidden:!0,children:n.translate("order_summary.description_label")})]}),i(U,{children:e.map(({digest:e,image:t,available:a,title:n,subtitle:r,quantity:l,properties:o})=>i(M,{children:[i(B,{children:i(G,{src:t?.one,srcSet:t?`${t.one} 1x, ${t.two} 2x, ${t.four} 4x`:void 0,alt:t?.altText,totalItems:l})}),i(B,{primary:!0,children:[i(w,{children:i(I,{type:"strong",children:n})}),r?i(w,{color:"subdued",children:r}):null,o?i(H,{properties:o}):null,null==a?null:i(he,{available:a})]})]},e))})]})]})}),i(d,{when:()=>"empty"!==Y.value&&"unavailable"!==Y.value,children:i(S,{padding:"large-200 none",children:i(x,{alignItems:"center",gap:"small-200",accessibilityRole:"footer",children:[i(w,{color:"subdued",textAlign:"center",children:n.translate("throttle.footer.heading")}),i(w,{color:"subdued",textAlign:"center",children:n.translate("throttle.footer.body")})]})})})]})})})})})})}function he({available:e}){return i(e?ce:ue,{})}export{de 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.