FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
components
Edit File: sc-order-confirmation-totals2.js
import{proxyCustomElement,HTMLElement,h,Fragment}from"@stencil/core/internal/client";import{a as getHumanDiscount}from"./price.js";import{o as openWormhole}from"./consumer.js";import{f as formatTaxDisplay}from"./tax.js";import{d as defineCustomElement$3}from"./sc-divider2.js";import{d as defineCustomElement$2}from"./sc-line-item2.js";import{d as defineCustomElement$1}from"./sc-tag2.js";const scOrderConfirmationTotalsCss=":host{display:block}",ScOrderConfirmationTotalsStyle0=":host{display:block}",ScOrderConfirmationTotals=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.order=void 0}renderDiscountLine(){var e,i,d,o,t,a,s,n,c,l,r,f,u,p;if(!(null===(d=null===(i=null===(e=this.order)||void 0===e?void 0:e.discount)||void 0===i?void 0:i.promotion)||void 0===d?void 0:d.code))return null;let v="";return(null===(t=null===(o=this.order)||void 0===o?void 0:o.discount)||void 0===t?void 0:t.coupon)&&(v=getHumanDiscount(null===(s=null===(a=this.order)||void 0===a?void 0:a.discount)||void 0===s?void 0:s.coupon)),h("sc-line-item",{style:{marginTop:"var(--sc-spacing-small)"}},h("span",{slot:"description"},wp.i18n.__("Discount","surecart"),h("br",null),(null===(l=null===(c=null===(n=this.order)||void 0===n?void 0:n.discount)||void 0===c?void 0:c.promotion)||void 0===l?void 0:l.code)&&h("sc-tag",{type:"success",size:"small"},null===(u=null===(f=null===(r=this.order)||void 0===r?void 0:r.discount)||void 0===f?void 0:f.promotion)||void 0===u?void 0:u.code)),v&&h("span",{class:"coupon-human-discount",slot:"price-description"},"(",v,")"),h("span",{slot:"price"},null===(p=this.order)||void 0===p?void 0:p.discounts_display_amount))}renderCheckoutFees(e){var i,d,o,t;return(null===(d=null===(i=null==e?void 0:e.checkout_fees)||void 0===i?void 0:i.data)||void 0===d?void 0:d.length)?h(Fragment,null,null===(t=null===(o=null==e?void 0:e.checkout_fees)||void 0===o?void 0:o.data)||void 0===t?void 0:t.map((e=>h("sc-line-item",{key:null==e?void 0:e.id},h("span",{slot:"description"},null==e?void 0:e.description),h("span",{slot:"price"},null==e?void 0:e.display_amount))))):null}renderShippingFees(e){var i,d,o,t;return(null===(d=null===(i=null==e?void 0:e.shipping_fees)||void 0===i?void 0:i.data)||void 0===d?void 0:d.length)?h(Fragment,null,null===(t=null===(o=null==e?void 0:e.shipping_fees)||void 0===o?void 0:o.data)||void 0===t?void 0:t.map((e=>h("sc-line-item",{key:null==e?void 0:e.id},h("span",{slot:"description"},null==e?void 0:e.description),h("span",{slot:"price"},null==e?void 0:e.display_amount))))):null}render(){var e,i,d,o,t,a,s,n,c,l,r,f,u,p,v,b,m,y,_,g,k,_x,w,x,C,E,T,S,$,z,F,D,j,O,H,L,P,A,B,M,W,N,R;const q=null===(i=null===(e=this.order)||void 0===e?void 0:e.selected_shipping_choice)||void 0===i?void 0:i.shipping_method,G=null==q?void 0:q.name;return h("div",{key:"7905ff73d7fb0c09bd5cf3b04975101891377663",class:{"line-item-totals":!0}},(null===(d=this.order)||void 0===d?void 0:d.subtotal_amount)!==(null===(o=this.order)||void 0===o?void 0:o.total_amount)&&h(Fragment,{key:"54ed2e70e1ff1d6e97e036d6a996118fd1bd92ca"},h("sc-line-item",{key:"1916bd8da4a951ff91e9c1609ad87ace3863c66a"},h("span",{key:"806250c5e6f721feba596f99a21152cc500438d1",slot:"description"},wp.i18n.__("Subtotal","surecart")),h("span",{key:"e67e41477c302ab5433ff7e24b4cfc3a70dd8fb0",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(t=this.order)||void 0===t?void 0:t.subtotal_display_amount)),this.renderCheckoutFees(this.order)),!!(null===(a=this.order)||void 0===a?void 0:a.trial_amount)&&h("sc-line-item",{key:"b9592d9ce147ff82fd13953a928546c2cd35d823"},h("span",{key:"e89e7a946e75c5c8a24a19b930d4c1e3e0c019b9",slot:"description"},wp.i18n.__("Trial","surecart")),h("span",{key:"d67cb4d399c272b52daff659c3c7f767cf0cf720",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(s=this.order)||void 0===s?void 0:s.trial_display_amount)),!!(null===(n=this.order)||void 0===n?void 0:n.discounts)&&h("sc-line-item",{key:"c67f4924f48f2a787102d0ce273b7e1d5fcfc9b0"},h("span",{key:"8ff940d826b3ad9393417ee3d05a89f49eb03abf",slot:"description"},wp.i18n.__("Discounts","surecart")),h("span",{key:"77c37a688bc6fc0aaa24e70531455cb95421917e",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(c=this.order)||void 0===c?void 0:c.discounts_display)),!!(null===(f=null===(r=null===(l=this.order)||void 0===l?void 0:l.discount)||void 0===r?void 0:r.promotion)||void 0===f?void 0:f.code)&&h("sc-line-item",{key:"781f93e4f54130fdb41914483f56bddceb917eb0"},h("span",{key:"95a6c9d35a81a81d7565beb6c6bf901f056985ee",slot:"description"},wp.i18n.__("Discount","surecart"),h("br",{key:"f30f5ec4a162bc073201fb47b047984a4c80ff6d"}),h("sc-tag",{key:"c2dc4fc80499495421ec8ad347d6c8930b9bc0b3",type:"success"},wp.i18n.__("Coupon:","surecart")," ",null===(v=null===(p=null===(u=this.order)||void 0===u?void 0:u.discount)||void 0===p?void 0:p.promotion)||void 0===v?void 0:v.code)),h("span",{key:"59c5eeb1ad96078fad29fdb02da0569a13f4eb56",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(b=this.order)||void 0===b?void 0:b.discounts_display_amount)),!!(null===(m=this.order)||void 0===m?void 0:m.shipping_amount)&&h(Fragment,{key:"fc16b9cba2ef7be61e466f716a130114f380f63f"},h("sc-line-item",{key:"81abb1fb7655e3bb672c359d18390efda37d0b25"},h("span",{key:"2add4634be4f66861aaca57ec7dca0631c094e5d",slot:"description"},`${wp.i18n.__("Shipping","surecart")} ${G?`(${G})`:""}`),h("span",{key:"ed66822347289f922d7be1eb02d8e166585119b1",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(y=this.order)||void 0===y?void 0:y.shipping_display_amount)),this.renderShippingFees(this.order)),!!(null===(_=this.order)||void 0===_?void 0:_.tax_amount)&&h("sc-line-item",{key:"b1a7fef17e2c0c868a84c7c4e67be8fa2969fadd"},h("span",{key:"d64ab15b7186d994590cafc42e0e144f03909f8b",slot:"description"},`${formatTaxDisplay(null===(g=this.order)||void 0===g?void 0:g.tax_label,"estimated"===(null===(k=this.order)||void 0===k?void 0:k.tax_status))} (${null===(_x=this.order)||void 0===_x?void 0:_x.tax_percent}%)`),h("span",{key:"53594a68aeaafbfd615d8691b84f9f24cb2bd908",slot:"price"},null===(w=this.order)||void 0===w?void 0:w.tax_display_amount),!!(null===(x=this.order)||void 0===x?void 0:x.tax_inclusive_amount)&&h("span",{key:"eeefdd6a2fa8ded12ca4c90da35566e4654503dd",slot:"price-description"},`(${wp.i18n.__("included","surecart")})`)),h("sc-divider",{key:"745891bc62f3abf0c7c96de0be16e31fff81835e",style:{"--spacing":"var(--sc-spacing-x-small)"}}),h("sc-line-item",{key:"555aefb1e1c0e6688bbc810fd534201833f60b0d",style:{width:"100%","--price-size":"var(--sc-font-size-x-large)"}},h("span",{key:"8cc81a8ea8e87b42c7eee17fa8abe2561d8d9d01",slot:"title"},wp.i18n.__("Total","surecart")),h("span",{key:"e09100d7a542232c151b99cd368401690fa361d3",slot:"price"},null===(C=this.order)||void 0===C?void 0:C.total_display_amount),h("span",{key:"796fcfdf686474f707c0cb88cd7526e7d23e8f51",slot:"currency"},null===(E=this.order)||void 0===E?void 0:E.currency)),!!(null===(T=this.order)||void 0===T?void 0:T.proration_amount)&&h("sc-line-item",{key:"bd224f0b5d7db84bf95d914f3b0094445b3f3e57"},h("span",{key:"8ca20929ec3148a718c45e7fceed3ae1edd90f9a",slot:"description"},wp.i18n.__("Proration","surecart")),h("span",{key:"1eb9da8071cddc51689cbaa5b1eeac2304054875",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(S=this.order)||void 0===S?void 0:S.proration_display_amount)),!!(null===($=this.order)||void 0===$?void 0:$.applied_balance_amount)&&h("sc-line-item",{key:"54818e1dfaa5823ec2071e42505b0ecd70da3edd"},h("span",{key:"aa850bae77b4c02f299e842fc743b68430c2e383",slot:"description"},wp.i18n.__("Applied Balance","surecart")),h("span",{key:"301ce8bff1d60bd98bea692f2320ea7e1df2c312",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"},slot:"price"},null===(z=this.order)||void 0===z?void 0:z.applied_balance_display_amount)),!!(null===(F=this.order)||void 0===F?void 0:F.credited_balance_amount)&&h("sc-line-item",{key:"ddac5a8dbae8dd17d3086fe421b665abcf1035fd"},h("span",{key:"935a3c9048a2c42127daad07554df3043e7c1d00",slot:"description"},wp.i18n.__("Credited Balance","surecart")),h("span",{key:"b25653cd44c0345dd666696ee3866f4603c94077",slot:"price",style:{"font-weight":"var(--sc-font-weight-semibold)",color:"var(--sc-color-gray-800)"}},null===(D=this.order)||void 0===D?void 0:D.credited_balance_display_amount)),(null===(j=this.order)||void 0===j?void 0:j.amount_due)!==(null===(O=this.order)||void 0===O?void 0:O.total_amount)&&h("sc-line-item",{key:"6c6c4f7de8920a5319861b3eea191aee8de8ccda",style:{width:"100%","--price-size":"var(--sc-font-size-x-large)"}},h("span",{key:"b0db1cfdf22211984353bf0fd56128e7dd764cb2",slot:"title"},wp.i18n.__("Amount Due","surecart")),h("span",{key:"2e939382b72e1a3a65a6279dca56127fd42da319",slot:"price"},null===(H=this.order)||void 0===H?void 0:H.amount_due_display_amount),h("span",{key:"0505b5d201fc48b39b5d17f834d80479bf27cbe1",slot:"currency"},null===(L=this.order)||void 0===L?void 0:L.currency)),h("sc-divider",{key:"5247e4b5e7a54ef47a18adfdd4bb4fa102f355be",style:{"--spacing":"var(--sc-spacing-x-small)"}}),!!(null===(P=this.order)||void 0===P?void 0:P.paid_amount)&&h("sc-line-item",{key:"791572bf758c3206d2642c0c6b91724876e09ddd",style:{width:"100%","--price-size":"var(--sc-font-size-x-large)"}},h("span",{key:"fe53fa0bf391b43d8b3f50ad1d07b2a3fd777097",slot:"title"},wp.i18n.__("Paid","surecart")),h("span",{key:"f64053cf8b14cc10afff9aa89d3cb12be000749d",slot:"price"},null===(A=this.order)||void 0===A?void 0:A.paid_display_amount),h("span",{key:"486a92d061fca3b54b29e421cd30436e9f83587d",slot:"currency"},null===(B=this.order)||void 0===B?void 0:B.currency)),!!(null===(M=this.order)||void 0===M?void 0:M.refunded_amount)&&h(Fragment,{key:"743a0b91b939cad95dc434e0656f716db1df07af"},h("sc-line-item",{key:"729acad876d36835e69ee52a1ad5ec346d452d3b",style:{width:"100%","--price-size":"var(--sc-font-size-x-large)"}},h("span",{key:"4ddfea07741ff409cdb11d2162636b61efa102cf",slot:"description"},wp.i18n.__("Refunded","surecart")),h("span",{key:"81ec53fe12278668e7cd0cb3af4afd794b683105",slot:"price"},null===(W=this.order)||void 0===W?void 0:W.refunded_display_amount)),h("sc-line-item",{key:"d09046ad733b898c0de5f63257251271d1ad7100",style:{width:"100%","--price-size":"var(--sc-font-size-x-large)"}},h("span",{key:"4342a05a76451eb8a0a6148df1c2d891e4f092a2",slot:"title"},wp.i18n.__("Net Payment","surecart")),h("span",{key:"3ffca702242ed7b86d889abc6c1a2b082b7da330",slot:"price"},null===(N=this.order)||void 0===N?void 0:N.net_paid_display_amount))),(null===(R=this.order)||void 0===R?void 0:R.tax_reverse_charged_amount)>0&&h("sc-line-item",{key:"6430beb4fac86b64098d4633a9ad955e4d1dd74e"},h("span",{key:"eba65d724dc6a0ceb610e40f34c9b23b75de39ec",slot:"description"},wp.i18n.__("*Tax to be paid on reverse charge basis","surecart"))))}static get style(){return":host{display:block}"}},[1,"sc-order-confirmation-totals",{order:[16]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-order-confirmation-totals","sc-divider","sc-line-item","sc-tag"].forEach((e=>{switch(e){case"sc-order-confirmation-totals":customElements.get(e)||customElements.define(e,ScOrderConfirmationTotals);break;case"sc-divider":customElements.get(e)||defineCustomElement$3();break;case"sc-line-item":customElements.get(e)||defineCustomElement$2();break;case"sc-tag":customElements.get(e)||defineCustomElement$1()}}))}openWormhole(ScOrderConfirmationTotals,["order","busy","loading","empty"],!1);export{ScOrderConfirmationTotals as S,defineCustomElement as d};
Save
Back