PageSourceSearch

https://gablewoodsacademy.com/wp-content/plugins/surecart/dist/components/surecart/p-56578443.entry.js

js gablewoodsacademy.com collected 2026-10-09 17:55:12 UTC 7,217 bytes, 2 lines download raw bytes

1import{r as t,c as e,h as s,a as i}from"./p-9add63ef.js";import{l as o,g as a}from"./p-a0974978.js";import"./p-8dccb656.js";import{g as n}from"./p-bdbb27c7.js";import{c}from"./p-78468e45.js";import{a as r}from"./p-259c3935.js";import"./p-401e165e.js";import"./p-d3366af3.js";import"./p-b6a933a1.js";import"./p-2b28ea49.js";import"./p-2f682959.js";import"./p-830ab1a3.js";import"./p-d15c4b50.js";import"./p-0cb2e619.js";import"./p-9cd438cc.js";import"./p-297962fd.js";const d=':host{display:block}.paypal-buttons{position:relative;line-height:0;text-align:center}.paypal-buttons:not(.paypal-buttons--busy):after{content:" ";border-bottom:1px solid var(--sc-input-border-color);width:100%;height:0;top:50%;left:0;right:0;position:absolute}';const l=d;const h=class{constructor(s){t(this,s);this.scSetState=e(this,"scSetState",7);this.scPaid=e(this,"scPaid",7);this.bootstrapId=0;this.clientId=undefined;this.busy=false;this.merchantId=undefined;this.merchantInitiated=undefined;this.mode=undefined;this.order=undefined;this.buttons=["paypal","card"];this.label="paypal";this.color="gold";this.loaded=false}handleOrderChange(t,e){if((t===null||t===void 0?void 0:t.currency)===(e===null||e===void 0?void 0:e.currency)&&Boolean(t===null||t===void 0?void 0:t.reusable_payment_method_required)===Boolean(e===null||e===void 0?void 0:e.reusable_payment_method_required)){return}this.loadScript()}handleButtonsChange(t,e){if((t===null||t===void 0?void 0:t.join())===(e===null||e===void 0?void 0:e.join()))return;this.loadScript()}async loadScript(){var t,e,s;if(!this.clientId||!this.merchantId)return;const i=++this.bootstrapId;this.loaded=false;try{const n=await o(a({clientId:this.clientId,merchantId:this.merchantId,merchantInitiated:this.merchantInitiated,reusable:(t=this.order)===null||t===void 0?void 0:t.reusable_payment_method_required,currency:(e=this.order)===null||e===void 0?void 0:e.currency,locale:(s=window.scData)===null||s===void 0?void 0:s.locale}));if(i!==this.bootstrapId)return;if(this.cardContainer){this.cardContainer.innerHTML=""}if(this.paypalContainer){this.paypalContainer.innerHTML=""}this.renderButtons(n)}catch(t){console.error("failed to load the PayPal JS SDK script",t)}}componentDidLoad(){this.loadScript()}renderButtons(t){const e=this.order.reusable_payment_method_required?"createBillingAgreement":"createOrder";const s={onClick:async(t,e)=>{const s=this.el.closest("sc-checkout");const i=await s.validate();return i?e.resolve():e.reject()},onInit:()=>{this.loaded=true},onCancel:()=>{this.scSetState.emit("REJECT")},onApprove:async()=>{var t,e,s,i;try{this.order=await n({id:(t=this.order)===null||t===void 0?void 0:t.id})}catch(t){console.error(t);c({code:"could_not_capture",message:wp.i18n.__("The payment did not process. Please try again.","surecart")});this.scSetState.emit("REJECT")}try{this.scSetState.emit("PAYING");const t=await r({method:"PATCH",path:`surecart/v1/payment_intents/${((s=(e=this.order)===null||e===void 0?void 0:e.payment_intent)===null||s===void 0?void 0:s.id)||((i=this.order)===null||i===void 0?void 0:i.payment_intent)}/capture`});if(["succeeded","processing"].includes(t===null||t===void 0?void 0:t.status)){this.scSetState.emit("PAID");this.scPaid.emit()}else{c({code:"could_not_capture",message:wp.i18n.__("Payment processing failed. Kindly attempt the transaction once more.","surecart")});this.scSetState.emit("REJECT")}}catch(t){console.error(t);c({code:"could_not_capture",message:wp.i18n.__("Payment processing failed. Kindly attempt the transaction once more.","surecart")});this.scSetState.emit("REJECT")}},onError:t=>{console.error(t);c(t);this.scSetState.emit("REJECT")}};s[e]=async()=>new Promise((async(t,e)=>{var s,i;const o=this.el.closest("sc-checkout");const a=await o.submit();if(a instanceof Error){return e(a)}if((a===null||a===void 0?void 0:a.status)!=="finalized"){return e(new Error("Something went wrong. Please try again."))}if((s=a===null||a===void 0?void 0:a.payment_intent)===null||s===void 0?void 0:s.external_intent_id){return t((i=a===null||a===void 0?void 0:a.payment_intent)===null||i===void 0?void 0:i.external_intent_id)}c({code:"missing_payment_intent",message:wp.i18n.__("Something went wrong. Please contact us for payment.","surecart")});return e()}));if(t.FUNDING.PAYPAL&&this.buttons.includes("paypal")){const e=t.Buttons({fundingSource:t.FUNDING.PAYPAL,style:{label:this.label,color:this.color},...s});if(e.isEligible()){e.render(this.paypalContainer).catch((t=>console.error("failed to render the PayPal button",t)))}}if(t.FUNDING.CARD&&this.buttons.includes("card")){const e=t.Buttons({fundingSource:t.FUNDING.CARD,style:{color:"black"},...s});if(e.isEligible()){e.render(this.cardContainer).catch((t=>console.error("failed to render the PayPal card button",t)))}}}render(){return s("div",{key:"b3157e1b376976219e2aaf806ddae33b4773de97",part:`base ${this.busy||!this.loaded&&"base--busy"}`,class:{"paypal-buttons":true,"paypal-buttons--busy":this.busy||!this.loaded}},(!this.loaded||this.busy)&&s("sc-skeleton",{key:"6718cdeb1aa36f1db25db8f4c15875ed27f1e02e",style:{height:"55px","--border-radius":"4px",cursor:"wait"}}),s("div",{key:"1140d5203820e1581d473fb3c6f8bc076ea1f577",class:"sc-paypal-button-container",hidden:!this.loaded||this.busy},s("div",{key:"383046c87558c40bfb517ddcd1b0d2942f40512d",part:"paypal-card-button",hidden:!this.buttons.includes("card"),class:"sc-paypal-card-button",ref:t=>this.cardContainer=t}),s("div",{key:"61aec56d76b14b60093dc5213431f6fe320c7ba6",part:"paypal-button",hidden:!this.buttons.includes("paypal"),class:"sc-paypal-button",ref:t=>this.paypalContainer=t})))}get el(){return i(this)}static get watchers(){return{order:["handleOrderChange"],buttons:["handleButtonsChange"]}}};h.style=l;const p=":host{display:block;--sc-secure-notice-icon-color:var(--sc-color-gray-300);--sc-secure-notice-font-size:var(--sc-font-size-small);--sc-secure-notice-color:var(--sc-color-gray-500)}.notice{color:var(--sc-secure-notice-color);font-size:var(--sc-secure-notice-font-size);display:flex;align-items:center;gap:5px}.notice__text{flex:1;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}.notice__icon{color:var(--sc-secure-notice-icon-color);margin-right:5px}";const u=p;const f=class{constructor(e){t(this,e)}render(){return s("div",{key:"0a7415001dd7d32c03073ecd0a16e20207552b10",class:"notice",part:"base"},s("svg",{key:"61ca5defd459c5552a026c3e1c0954bc26fa48b7",class:"notice__icon",part:"icon",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"
1currentColor"},s("path",{key:"d439c6c8775e6b32b3cdf0679da68d8928c171e9",d:"M368,192H352V112a96,96,0,1,0-192,0v80H144a64.07,64.07,0,0,0-64,64V432a64.07,64.07,0,0,0,64,64H368a64.07,64.07,0,0,0,64-64V256A64.07,64.07,0,0,0,368,192Zm-48,0H192V112a64,64,0,1,1,128,0Z"})),s("span",{key:"f0684909fed6fade6c615ce30389545c928369fd",class:"notice__text",part:"text"},s("slot",{key:"0171cdf6ae159dcc6afc7a5db85fd3d6e524a2d1",name:"prefix"}),s("slot",{key:"64baf61e6cf6c15da9495a9a9dd6b7168bc0b33a"}),s("slot",{key:"41629d1d4df88dfbc254ef53b3f905eff0745077",name:"suffix"})))}};f.style=u;export{h as sc_paypal_buttons,f as sc_secure_notice};
2//# sourceMappingURL=p-56578443.entry.js.map

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.