1import{B as I}from"./BaseElement.DcZImwKN.min.js";import{g as N,p as M}from"./algoliaHitStorage.DZFmt5at.min.js";import{a as L}from"./algoliaUrlParams.D041RnRL.min.js";import{c as P}from"./badgeHydrator.huZstDsr.min.js";import{W as _}from"./WithApiClient.IaGgbJQC.min.js";import{h as C}from"./task.BIuG9C6l.min.js";import{x}from"./lit-element.mvcqtviJ.min.js";import{t as O}from"./custom-element.BhZVzxrc.min.js";import{n as w}from"./property.C7OeqhA5.min.js";import{r as D}from"./query-all.D646pH-D.min.js";import{o as R}from"./unsafe-html.BXKrt2Ko.min.js";import"./index.CKJCYK2x.min.js";import"./base.CShCMygk.min.js";import"./directive.C_Rw-dL6.min.js";const $="js-cle-state-matched";function T(t,e){if(!e)return t;const r=document.createElement("template");r.innerHTML=t;const i=r.content.querySelector(`.${$}`);return i?(i.innerHTML=e,r.innerHTML):t}var j=Object.defineProperty,B=Object.getOwnPropertyDescriptor,y=(t,e,r,i)=>{for(var a=i>1?void 0:i?B(e,r):e,s=t.length-1,n;s>=0;s--)(n=t[s])&&(a=(i?n(e,r,a):n(a))||a);return i&&a&&j(e,r,a),a};const q=`#graphql 2 query getProductVariantsFromNode($id: ID!) { 3 node(id: $id) { 4 id 5 ... on ProductVariant { 6 product { 7 handle 8 } 9 } 10 } 11 } 12`,V=`#graphql 13 query getProductById($id: ID!) { 14 node(id: $id) { 15 id 16 ... on Product { 17 handle 18 } 19 } 20 } 21`,E={},b={},S={},k=150,F=300;let p=class extends _(I){constructor(){super(...arguments),this.template="product-card",this.urlPostfix="",this.checkIfResponseHasLayout=t=>t.match(/<(html|body)/),this._loadVariantByIdTask=new C(this,{task:async([t])=>{var r,i,a,s,n,d;if(!t)throw new Error("No variantId provided");if(b[t])return b[t];const e=await this.$api.client.storefront({body:{query:q,variables:{id:`gid://shopify/ProductVariant/${t}`}}});if(!((a=(i=(r=e.data)==null?void 0:r.node)==null?void 0:i.product)!=null&&a.handle))throw new Error("No product handle found");return b[t]=(d=(n=(s=e.data)==null?void 0:s.node)==null?void 0:n.product)==null?void 0:d.handle,b[t]},args:()=>[this.variantId]}),this._loadProductByIdTask=new C(this,{task:async([t])=>{var r,i;if(!t)throw new Error("No productId provided");if(S[t])return S[t];const e=await this.$api.client.storefront({body:{query:V,variables:{id:`gid://shopify/Product/${t}`}}});if(!((i=(r=e.data)==null?void 0:r.node)!=null&&i.handle))throw new Error("No product handle found");return S[t]=e.data.node.handle,S[t]},args:()=>[this.productId]}),this.loadProductHandleView=new C(this,{task:async([t])=>{if(!t)throw new Error("No handle provided");if(E[this.cacheKey])return await this.waitOneSecond(F),E[this.cacheKey];const e=await this.$api.client.shopify(`products/${t}`,{method:"GET",headers:{"Content-Type":"text/html"}},{params:{view:this.template,layout:"none",...this.variantId&&{variant:this.variantId}},persistCache:!0,persistCacheExpiryMs:5*60*1e3});if(this.checkIfResponseHasLayout(e))throw new Error("Invalid response");if(e)return E[this.cacheKey]=e,await this.waitOneSecond(k),e;throw new Error("No product found")},args:()=>[this.handle||this._loadProductByIdTask.value||this._loadVariantByIdTask.value,this.variantId]}),this.badgeHydrator=P({getStorefrontClient:()=>{var t;return((t=this.$api)==null?void 0:t.client.storefront)??null}}),this.handleAlgoliaHitClick=t=>{var c,h,f,g,v;const e=t.currentTarget;if(!e)return;const r=e.dataset||{},i=this.dataset||{},a=r.algoliaQueryId||i.algoliaQueryId,s=r.algoliaObjectId||i.algoliaObjectId,n=r.algoliaIndexName||i.algoliaIndexName||((h=(c=window==null?void 0:window.algoliaShopify)==null?void 0:c.instantsearch)==null?void 0:h.indexName)||((g=(f=window==null?void 0:window.algoliaShopify)==null?void 0:f.config)==null?void 0:g.indexName),d=r.algoliaPosition||i.algoliaPosition;if(!a||!s||!n)return;const l=N();if(!l)return;const u={index:n,eventName:"Search Result Click",objectIDs:[String(s)],queryID:a};if(d){const m=parseInt(d,10);Number.isNaN(m)||(u.positions=[m])}try{l("clickedObjectIDsAfterSearch",u)}catch(m){console.error("Failed to report Algolia click analytics event",m)}const o=r.algoliaHandle||this.dataset.algoliaHandle||this.handle||"";o&&s&&M({handle:o,objectID:String(s),queryID:a,indexName:n,position:typeof((v
21=u.positions)==null?void 0:v[0])=="number"?u.positions[0]:null})}}createRenderRoot(){return this}get cacheKey(){return`${this.handle}-${this.variantId}-${this.productId}-${this.template}`}_renderPostfix(){if(!this.urlPostfix)return;const t=Array.from(this.productUrls);if(t.length!==0)for(const e of t){const r=e;if(r&&(r.href||r.getAttribute("product-url"))){const i=new URL(r.href||r.getAttribute("product-url")),a=this.urlPostfix.split("=");a.length===2?i.searchParams.append(a[0],a[1]):console.error('urlPostfix does not contain exactly one "=" character.'),r.href?r.href=i.toString():r.setAttribute("product-url",i.toString())}}}async hydrateBadgePayloadsFromHTML(t){await this.badgeHydrator.hydratePayloadsFromHTML(t)}async applyBadgePayloadsToDom(){await this.badgeHydrator.hydrateScriptsInRoot(this)}async updated(){this._renderPostfix(),requestAnimationFrame(()=>{this.applyAlgoliaInsightsMetadata(),this.applyBadgePayloadsToDom()})}waitOneSecond(t){return new Promise(e=>setTimeout(e,t))}applyAlgoliaInsightsMetadata(){var s,n,d,l,u;const t=this.dataset||{},e=t.algoliaQueryId,r=t.algoliaObjectId,i=t.algoliaIndexName||((n=(s=window==null?void 0:window.algoliaShopify)==null?void 0:s.instantsearch)==null?void 0:n.indexName)||((l=(d=window==null?void 0:window.algoliaShopify)==null?void 0:d.config)==null?void 0:l.indexName);if(this.handle&&(t.algoliaHandle=this.handle),!e||!r||!i)return;const a=t.algoliaPosition;(u=this.productUrls)==null||u.forEach(o=>{e&&(o.dataset.algoliaQueryId=e),o.dataset.algoliaObjectId=r,o.dataset.algoliaIndexName=i,a&&(o.dataset.algoliaPosition=a),this.handle&&(o.dataset.algoliaHandle=this.handle),this.decorateLinkWithAlgoliaParams(o,{queryID:e,objectID:r,indexName:i,position:a,handle:o.dataset.algoliaHandle||this.handle}),o.dataset.algoliaInsightsBound!=="true"&&(o.dataset.algoliaInsightsBound="true",o.addEventListener("click",this.handleAlgoliaHitClick))})}decorateLinkWithAlgoliaParams(t,e){if(!(t!=null&&t.href))return;const r=L(t.href,e);t.href=r}detectStateFromPathname(){const e=(window.location.pathname.toLowerCase().split("/").pop()||"").split("-"),r=e.join(" ");for(const[i,a]of p.STATE_NAMES_SORTED)if(r.includes(i))return a;for(const i of e)if(i.length===2&&p.STATE_ABBREVS.has(i))return i.toUpperCase();return null}formatCreditHours(t){return t%1===0?String(Math.floor(t)):String(parseFloat(t.toFixed(2)))}buildCreditTypeHoursMap(t){const e={};return t.forEach(r=>{const i=r["credit-title"],a=r["credit-type"];i&&Array.isArray(a)&&a.forEach(s=>{var l;const n=(l=s["credit-name"])==null?void 0:l.replace(/\\\\/g,"\\").replace(/\\/g,"/"),d=s["credit-value"];if(n&&d!==void 0){const u=`${i}: ${n}`;e[u]=String(d)}})}),e}buildCreditTypeSuffix(t,e,r){const i=[];for(const[a,s]of e.entries()){if(!a.includes("refinementList[meta.custom.credit_type]"))continue;const n=s.split(": ");if(n.length!==2||n[0]!==t)continue;const d=n[1],l=r[s];i.push(l?`${l} ${d}`:d)}return i.length===0?"":`, including ${i.join(", ")}`}buildCreditLineHtml(t){return`<div class="flex items-center gap-x-[5px] caption text-[12px] font-medium leading-[1.3] text-t-secondary-blue"><svg-icon src="icon-credits" class="" style="--icon-size: 15px;"></svg-icon> 22 ${t}</div>`}buildMatchedCreditLines(t,e){const r=window.selectedCreditRefinements??{cle:[],paralegal:[],other:[]};if(!(r.cle.length>0||r.paralegal.length>0||r.other.length>0))return[];const a=o=>{for(const f of t){const[g,v]=f.split(":");if(o===g)return{title:g,hours:v,category:"CLE"}}const c=e.find(f=>f["credit-category"]==="CLE"&&f["credit-title"]===o);if(!c)return null;const h=Number(c["credit-total"])||0;return h<=0?null:{title:String(c["credit-title"]),hours:this.formatCreditHours(h),category:"CLE"}},s=(o,c)=>{const h=e.find(g=>g["credit-category"]===c&&g["credit-title"]===o);if(!h)return null;const f=Number(h["credit-total"])||0;return f<=0?null:{title:String(h["credit-title"]),hours:this.formatCreditHours(f),category:c}},n=(o,c)=>o.title.localeCompare(c.title),d=r.cle.map(a).filter(o=>o!==null).sort(n),l=r.paralegal.map(o=>s(o,"Paralegal")).filter(o=>o!==null).sort(n),u=r.other.map(o=>s(o,"Other")).filter(o=>o!==null).sort(n);return[...d,...l,...u].slice(0,3)}
22buildCreditLinesHtml(t,e){const r=new URLSearchParams(location.search);let i="";return t.forEach(a=>{let s=`${a.hours} ${a.title}`;s+=this.buildCreditTypeSuffix(a.title,r,e),i+=this.buildCreditLineHtml(s)}),i}buildHorizontalCreditsHtml(t,e,r){const i=this.buildMatchedCreditLines(t,e);return i.length===0?"":this.buildCreditLinesHtml(i,r)}injectVerticalStateCredits(t){const r=new DOMParser().parseFromString(t,"text/html"),i=r.querySelector("#meta-course-credits");if(!(i!=null&&i.innerHTML.trim()))return t;let a;try{a=JSON.parse(i.innerHTML.trim())}catch{return t}if(!Array.isArray(a))return t;const s=r.querySelector("#meta-credit-hours");let n=[];if(s!=null&&s.innerHTML.trim())try{n=JSON.parse(s.innerHTML.trim())}catch{n=[]}const d=Array.isArray(n)?n:[],l=window.selectedCreditRefinements??{cle:[],paralegal:[],other:[]};if(l.cle.length>0||l.paralegal.length>0||l.other.length>0){const m=this.buildMatchedCreditLines(d,a);if(m.length>0){const A=this.buildCreditTypeHoursMap(a),H=this.buildCreditLinesHtml(m,A);return T(t,H)}return t}const o=this.detectStateFromPathname();if(!o)return t;const c=a.filter(m=>String(m["credit-state"]??"").toUpperCase()===o&&m["credit-category"]==="CLE");if(c.length===0)return t;const h=c.reduce((m,A)=>m+(Number(A["credit-total"])||0),0);if(h<=0)return t;const f=h%1===0?String(Math.floor(h)):String(parseFloat(h.toFixed(2))),g=String(c[0]["credit-title"]||`${o} CLE`),v=`<div class="flex items-center gap-x-[5px] text-t-secondary-blue"><div><svg-icon src="icon-credits" style="--icon-size: 15px;"></svg-icon></div><div class="caption font-medium text-t-secondary-blue">${f} <span>${g}</span></div></div>`;return T(t,v)}dispatchLoadError(){this.dispatchEvent(new CustomEvent("product-card-error",{bubbles:!0,composed:!0}))}render(){return x` 23 ${this.loadProductHandleView.render({pending:()=>x` 24 <div 25 class="bg-white group relative flex w-full flex-col gap-[20px] overflow-hidden rounded-[10px] border border-t-grey-200 p-sm md:flex-row" 26 > 27 <div class="block w-full md:w-[255px]"> 28 <div class="aspect-[4/3] rounded-[10px] bg-t-grey-100"></div> 29 </div> 30 <div 31 class="flex flex-1 flex-col gap-md md:justify-between md:gap-1" 32 > 33 <div class="flex flex-wrap gap-2xs"> 34 <div class="h-6 w-[90px] rounded bg-t-grey-100"></div> 35 <div class="h-6 w-[90px] rounded bg-t-grey-100"></div> 36 </div> 37 <div class="flex flex-1 flex-col gap-xs md:gap-2xs"> 38 <div class="h-[22px] w-[140px] rounded bg-t-grey-100"></div> 39 <div class="h-[17px] w-[95%] rounded bg-t-grey-100"></div> 40 </div> 41 <div class="flex flex-row flex-wrap gap-[10px]"> 42 <div class="h-[19px] w-[110px] rounded bg-t-grey-100"></div> 43 <div class="h-[19px] w-[110px] rounded bg-t-grey-100"></div> 44 </div> 45 <div class="h-[21px] w-full rounded bg-t-grey-100"></div> 46 </div> 47 <div class="hidden md:block"> 48 <div 49 class="btn mx-auto my-auto h-[40px] w-[90px] rounded-full bg-t-grey-100" 50 ></div> 51 </div> 52 </div> 53 `,error:()=>(setTimeout(()=>this.dispatchLoadError(),0),x``),complete:t=>{if(!t)return;let e=t;if(this.template==="product-card-horizontal"){const i=new DOMParser().parseFromString(e,"text/html"),a=i.querySelector("#meta-credit-hours"),s=a?a.innerHTML.trim()?JSON.parse(a.innerHTML.trim()):[]:[],n=i.querySelector("#meta-course-credits"),d=n?n.innerHTML.trim()?JSON.parse(n.innerHTML.trim()):[]:[],l=Array.isArray(d)?d:[],u=this.buildCreditTypeHoursMap(l),o=Array.isArray(s)?s:[],c=this.buildHorizontalCreditsHtml(o,l,u);e=T(e,c)}return this.template==="product-card-vertical"&&(e=this.injectVerticalStateCredits(e)),this.hydrateBadgePayloadsFromHTML(e),x`<div class="dynamic-product-card-content w-full"> 54 ${R(e)} 55 </div>`}})} 56 `}};p.STATE_ABBREVS=new Set(["al","ak","az","ar","ca","co","ct","de","fl","ga","hi","id","il","in","ia","ks","ky","la","me","md","ma","mi","mn","ms","mo","mt","ne","nv","nh","nj","nm","ny","nc","nd","oh","ok","or","pa","ri","sc","sd","tn","tx","ut","vt","va","wa","wv","wi","wy"]);p.STATE_NAMES={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"
56CA",colorado:"CO",connecticut:"CT",delaware:"DE",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","west virginia":"WV",wisconsin:"WI",wyoming:"WY"};p.STATE_NAMES_SORTED=Object.entries(p.STATE_NAMES).sort((t,e)=>e[0].length-t[0].length);y([w({type:String,attribute:"variant-id"})],p.prototype,"variantId",2);y([w({type:String})],p.prototype,"handle",2);y([w({type:String,attribute:"product-id"})],p.prototype,"productId",2);y([w({type:String})],p.prototype,"template",2);y([w({type:String,attribute:"url-postfix"})],p.prototype,"urlPostfix",2);y([D("[data-product-url]")],p.prototype,"productUrls",2);p=y([O("dynamic-product-card")],p);
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.