PageSourceSearch

https://www.grays-hockey.com/cdn/shopifycloud/checkout-web/assets/c1/extensions-remote-dom.Ca77wI-c.js

js grays-hockey.com collected 2026-09-29 00:00:49 UTC 5,013 bytes, 1 lines download raw bytes

1import{R as I}from"./utilities-extension-execution-errors.BbHw1F9O.js";import{y as f,n as M,u as T,S as g,Q as Y,A as $,h as L,R as U}from"./esnext-vendor.DDpcaSqU.js";const w=1,b=3,y=8,D=9,A=0,S=1,j=2,F=3,N=1,V=2,x=3,O="~";function z({call:s,insertChild:n,removeChild:i,updateText:o,updateProperty:p}){const d={[A]:n,[S]:i,[j]:o,[F]:p};return{call:s,mutate(l){for(const[u,...e]of l)d[u](...e)}}}class H{root={id:O,type:D,properties:f({}),attributes:f({}),eventListeners:f({}),children:f([])};attached=new Map([[O,this.root]]);parents=new Map;implementations=new Map;constructor({retain:n,release:i}={}){const{attached:o,parents:p}=this,d=z({call:(e,r,...t)=>{const a=this.implementations.get(e)?.[r];if(typeof a!="function")throw new Error(`Node ${e} does not implement the ${r}() method`);return a(...t)},insertChild:(e,r,t)=>{const c=o.get(e);if(!c)return;const a=[...c.children.peek()],m=l(r,c);t===a.length?a.push(m):a.splice(t,0,m),c.children.value=a},removeChild:(e,r)=>{const t=o.get(e);if(!t)return;const c=[...t.children.peek()],[a]=c.splice(r,1);a&&(t.children.value=c,u(a))},updateProperty:(e,r,t,c=N)=>{const a=o.get(e);if(!a)return;let m;switch(c){case N:m=a.properties;break;case V:m=a.attributes;break;case x:m=a.eventListeners;break}const P=m.peek(),E=P[r];if(Object.is(E,t))return;n?.(t);const _={...P};if(_[r]=t,m.value=_,r==="slot"){const h=this.parents.get(e),R=h==null?h:o.get(h);R&&(R.children.value=[...R.children.peek()])}i?.(E)},updateText:(e,r)=>{const t=o.get(e);t&&(t.data.value=r)}});this.connection={call:d.call,mutate(e){M(()=>{d.mutate(e)})}};function l(e,r){let t;switch(e.type){case b:case y:{const{id:c,type:a,data:m}=e;t={id:c,type:a,data:f(m)};break}case w:{const{id:c,type:a,element:m,children:P,properties:E,attributes:_,eventListeners:h}=e;n?.(E),n?.(h);const R=[];t={id:c,type:a,element:m,children:f(R),properties:f(E??{}),attributes:f(_??{}),eventListeners:f(h??{})};for(const k of P)R.push(l(k,t));break}default:throw new Error(`Unknown node type: ${JSON.stringify(e)}`)}return o.set(t.id,t),p.set(t.id,r.id),t}function u(e){if(o.delete(e.id),p.delete(e.id),i&&"properties"in e&&i(e.properties.peek()),"children"in e)for(const r of e.children.peek())u(r)}}implement({id:n},i){i==null?this.implementations.delete(n):this.implementations.set(n,i)}get({id:n}){return this.attached.get(n)}}function v(s,{receiver:n,components:i}){switch(s.type){case w:{const o=i.get(s.element);if(o==null)throw new Error(`No component found for remote element: ${s.element}`);return T(o,{element:s,receiver:n,components:i},s.id)}case b:return s.data;case y:return null;default:throw new Error(`Unknown remote node type: ${String(s)}`)}}function X(s,n){if(!s)return;const{children:i,properties:o,attributes:p,eventListeners:d}=s,l=d.value,u=[],e={...o.value,...p.value};if(n.eventProps)for(const[r,t]of Object.entries(n.eventProps)){const c=t?.event;if(c==null)continue;const a=l[c];a&&(e[r]=C(a))}else for(const[r,t]of Object.entries(l))e[`on${r[0].toUpperCase()}${r.slice(1)}`]=C(t);for(const r of i.value){let t=r.type===1?r.attributes.peek().slot:void 0;if(typeof t!="string"&&(t=void 0),t){const c=v(r,n);e[t]=e[t]?T(g,{children:[e[t],c]}):c}else u.push(v(r,n))}return{...e,children:u}}function C(s){return function(...i){if(i.length===1&&i[0]instanceof Event){const o=i[0];return o.target!==o.currentTarget?void 0:"detail"in o?s(o.detail):s()}return s(...i)}}const B=Symbol.for("remote-dom.element");function J(s,{name:n,eventProps:i}={}){const o=Y(function({element:d,receiver:l,components:u}){const e=$(),{id:r}=d,t=X(d,{receiver:l,components:u,eventProps:i});if(t[B]=d,e.current==null){const c={id:r,receiver:l};c.instanceRef=Q(c),e.current=c}return e.current.id=r,e.current.receiver=l,L(()=>{const c={id:r};return l.implement(c,e.current?.instanceRef.current),()=>{l.implement(c,null)}},[r,l]),T(s,{ref:e.current.instanceRef,...t})});return o.displayName=n??`RemoteComponentRenderer(${s.displayName??s.name??"Component"})`,o}function Q(s){let n=null;return{get current(){return n},set current(i){n=i,s.receiver.implement(s,i)}}}const W=function({element:n,receiver:i,components:o}){const p={receiver:i,components:o};return T(g,{children:n.children.value.map(d=>v(d,p))})};function q(s){const{receiver:n}=s,i=n.root.children.value;return T(g,{children:i.map(o=>v(o,s))})}const Z=q,ee=J,te=W;class ne extends H{constructor(n){super({retain:U,release:()=>{}});const i=this.connection.call;this.connection.call=(o,p,...d)=>{try{return i(o,p,...d)}catch(l){if(l instanceof Error&&l.message.includes("does not implement the")){const u=this.get({id:String(o)}),e=u&&"element"in u?u.element:void 0,r=e?`Node ${o} (${e})`:`Node ${o}`;throw new I(`${r} does not implement the ${p}() method. `,{metadata:{nodeId:o,method:p,nodeType:e,extensionId:n?.id,extensionName:n?.name,extensionTarget:n?.extensionPoint.target,appId:n?.appId,appName:n?.appName,a
1piVersion:n?.apiVersion}})}throw l}}}}export{ne as L,A as M,w as N,O as R,S as a,F as b,y as c,j as d,b as e,Z as f,te as g,ee as h,v as r};

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.