1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4994],{49756:(e,s,a)=>{a.r(s),a.d(s,{default:()=>h});var n=a(73365),r=a(1521),c=a(56702),d=a.n(c),l=a(5269),t=a(7805),i=a(9316),m=a(16336),o=a(89226),u=a(92931),f=a(62853);function h({sku:e,loginLabel:s="Log in to buy",addToCartLabel:a="Add to cart",addedLabel:c="Added!",viewCartLabel:p="View cart",accessNowLabel:b="Access now",errorMessage:x="Error, try again.",alreadyPurchasedLabel:j,fullWidth:A,alignSuccessMessage:g="left",disabled:v=!1}){let N=(0,r.useRef)(null),{ready:y,isLoggedIn:E,loginUrl:_}=(0,o.A)(),{status:k,details:w,isInCart:C}=(0,u.xD)(e),{addToCart:L,status:R,error:U}=(0,u.AP)(e),P=(0,r.useCallback)(function(e){N.current?.addEventListener("transitionend",function s(a){a.target===N.current&&(N.current?.removeEventListener("transitionend",s,!1),e())},!1)},[]),O="error"===k||"ready"===k&&!w,$=!!w?.HasPurchased,z=!!w?.IsAllowMultiplePurchases,D=$&&!z&&w?.ResourceUrl&&b,H=d()("aafp-commerce-btn",`aafp-commerce-btn--align-message-${g}`,A&&"aafp-commerce-btn--full-width");return y&&"loading"!==k?O?null:E?D?(0,n.jsxs)("div",{className:`${H} aafp-commerce-btn--purchased`,children:[j&&(0,n.jsx)("p",{className:"type-body-sm mb-4",children:j}),(0,n.jsx)(t.A,{href:w?.ResourceUrl,children:b})]}):(0,n.jsxs)("div",{className:d()(H,C&&"aafp-commerce-btn--added"),children:[(0,n.jsx)(l.A,{nodeRef:N,in:C,classNames:"aafp-commerce-btn__added-message-",mountOnEnter:!0,unmountOnExit:!0,addEndListener:P,children:(0,n.jsxs)("span",{ref:N,className:"aafp-commerce-btn__added-message type-body-sm-bold",children:[(0,n.jsx)(i.A,{name:"check",size:32}),c]})}),C&&(0,n.jsx)(t.A,{href:f.U.cartUrl,variant:"secondary",children:p}),!C&&(0,n.jsx)(t.A,{onClick:()=>L(),loading:"pending"===R,disabled:v||$&&!z,children:a}),!!U&&(0,n.jsx)("div",{className:"aafp-form-error-message",children:x})]}):(0,n.jsx)("div",{className:H,children:(0,n.jsx)(t.A,{href:_,children:s})}):(0,n.jsx)("div",{className:H,children:(0,n.jsx)(m.A,{label:s})})}}}]);
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.