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