"use strict";(self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[]).push([[8822],{7279:function(e,t,r){r.d(t,{o:function(){return i}});var n=r(6892),i=function(e,t,r){void 0===r&&(r=!0);var i="Function"===e.constructor.name?e.prototype:e,o=i.componentWillLoad;i.componentWillLoad=function(){var e,i=this,l=(0,n.a)(this),s={promise:new Promise((function(t){e=t})),resolve:e},a=new CustomEvent("openWormhole",{bubbles:!0,composed:!0,detail:{consumer:this,fields:t,updater:function(e,t){(e in l?l:i)[e]=t},onOpen:s}});l.dispatchEvent(a);var c=function(){if(o)return o.call(i)};return r?s.promise.then((function(){return c()})):c()}}},8822:function(e,t,r){r.r(t),r.d(t,{sc_order_detail:function(){return u}});var n=r(6892),i=r(7279);function o(e,t,r){t="number"==typeof t?a(t.toString()):"string"==typeof t?a(t):t;const n=(e,t,r,i)=>{let o,l=t[i];return t.length>i?(Array.isArray(e)?(l=s(l,e),o=e.slice()):o=Object.assign({},e),o[l]=n(void 0!==e[l]?e[l]:{},t,r,i+1),o):"function"==typeof r?r(e):r};return n(e,t,r,0)}function l(e,t,r){t="number"==typeof t?a(t.toString()):"string"==typeof t?a(t):t;for(var n=0;n<t.length;n++){if(null===e||"object"!=typeof e)return r;let i=t[n];Array.isArray(e)&&"$end"===i&&(i=e.length-1),e=e[i]}return void 0===e?r:e}function s(e,t){if("$end"===e&&(e=Math.max(t.length-1,0)),!/^\+?\d+$/.test(e))throw new Error(`Array index '${e}' has to be an integer`);return parseInt(e)}function a(e){return e.split(".").reduce(((e,t,r,n)=>{const i=r>0&&n[r-1];if(i&&/(?:^|[^\\])\\$/.test(i)){const r=e.pop();e.push(r.slice(0,-1)+"."+t)}else e.push(t);return e}),[])}var c={set:o,get:l,delete:function(e,t){t="number"==typeof t?a(t.toString()):"string"==typeof t?a(t):t;const r=(e,t,n)=>{let i,o=t[n];return null===e||"object"!=typeof e||!Array.isArray(e)&&void 0===e[o]?e:t.length-1>n?(Array.isArray(e)?(o=s(o,e),i=e.slice()):i=Object.assign({},e),i[o]=r(e[o],t,n+1),i):(Array.isArray(e)?(o=s(o,e),i=[].concat(e.slice(0,o),e.slice(o+1))):(i=Object.assign({},e),delete i[o]),i)};return r(e,t,0)},toggle:function(e,t){const r=l(e,t);return o(e,t,!Boolean(r))},merge:function(e,t,r){const n=l(e,t);return"object"==typeof n?Array.isArray(n)?o(e,t,n.concat(r)):o(e,t,null===n?r:Object.assign({},n,r)):void 0===n?o(e,t,r):e}};const u=class{constructor(e){(0,n.r)(this,e),this.order=void 0,this.value=void 0,this.fallback=void 0,this.metaKey=void 0,this.loading=void 0,this.label=void 0}getPropByPath(e,t,r){return e&&t.length?this.getPropByPath(e[t.shift()],t,r):void 0===e?r:e}getValue(){var e,t;if(!this.value)return;let r="";return"metadata"===this.value?c.get(null===(e=null==this?void 0:this.order)||void 0===e?void 0:e.metadata,this.value||""):(r=c.get(null==this?void 0:this.order,this.value||""),"number"==typeof r&&(r=(0,n.h)("sc-format-number",{type:"currency",currency:null===(t=null==this?void 0:this.order)||void 0===t?void 0:t.currency,value:r})),r)}render(){if(this.loading)return(0,n.h)("div",{part:"base",class:{"order-detail":!0}},(0,n.h)("span",{part:"label",class:"order-detail__label"},(0,n.h)("sc-skeleton",{style:{width:"60px",height:"8px",display:"inline-block"}})),(0,n.h)("span",{part:"value",class:"order-detail__value"},(0,n.h)("sc-skeleton",{style:{width:"120px",display:"inline-block"}})));const e=this.getValue();return e||this.fallback?(0,n.h)("div",{part:"base",class:{"order-detail":!0}},(0,n.h)("span",{part:"label",class:"order-detail__label"},(0,n.h)("slot",{name:"label"},this.label)),(0,n.h)("span",{part:"value",class:"order-detail__value"},(0,n.h)("slot",{name:"value"},e||this.fallback))):void 0}};(0,i.o)(u,["order","loading"],!1),u.style=":host{display:block}.order-detail__value{display:block;font-weight:var(--sc-font-weight-semibold);line-height:var(--sc-line-height-dense)}.order-detail__label{display:block;color:var(--sc-color-gray-500);line-height:var(--sc-line-height-dense)}"}}]);