PageSourceSearch

https://ecn.net.au/_nuxt/BDLW59ml.js

js ecn.net.au collected 2026-10-02 13:01:10 UTC 14,190 bytes, 5 lines download raw bytes

1import{Z as K}from"./DYfXanV7.js";const Z={bodySerializer:e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r)},X=({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:a,responseValidator:n,sseDefaultRetryDelay:c,sseMaxRetryAttempts:s,sseMaxRetryDelay:o,sseSleepFn:u,url:l,...h})=>{let d;const i=u??(y=>new Promise(p=>setTimeout(p,y)));return{stream:async function*(){let y=c??3e3,p=0;const R=h.signal??new AbortController().signal;for(;!R.aborted;){p++;const A=h.headers instanceof Headers?h.headers:new Headers(h.headers);d!==void 0&&A.set("Last-Event-ID",d);try{const m={redirect:"follow",...h,body:h.serializedBody,headers:A,signal:R};let _=new Request(l,m);e&&(_=await e(l,m));const b=await(h.fetch??globalThis.fetch)(_);if(!b.ok)throw new Error(`SSE failed: ${b.status} ${b.statusText}`);if(!b.body)throw new Error("No body in SSE response");const C=b.body.pipeThrough(new TextDecoderStream).getReader();let S="";const I=()=>{try{C.cancel()}catch{}};R.addEventListener("abort",I);try{for(;;){const{done:M,value:Q}=await C.read();if(M)break;S+=Q;const v=S.split(`
2
3`);S=v.pop()??"";for(const G of v){const Y=G.split(`
4`),T=[];let x;for(const g of Y)if(g.startsWith("data:"))T.push(g.replace(/^data:\s*/,""));else if(g.startsWith("event:"))x=g.replace(/^event:\s*/,"");else if(g.startsWith("id:"))d=g.replace(/^id:\s*/,"");else if(g.startsWith("retry:")){const B=Number.parseInt(g.replace(/^retry:\s*/,""),10);Number.isNaN(B)||(y=B)}let E,z=!1;if(T.length){const g=T.join(`
5`);try{E=JSON.parse(g),z=!0}catch{E=g}}z&&(n&&await n(E),a&&(E=await a(E))),r?.({data:E,event:x,id:d,retry:y}),T.length&&(yield E)}}}finally{R.removeEventListener("abort",I),C.releaseLock()}break}catch(m){if(t?.(m),s!==void 0&&p>=s)break;const _=Math.min(y*2**(p-1),o??3e4);await i(_)}}}()}},ee=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},te=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},re=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},O=({allowReserved:e,explode:t,name:r,style:a,value:n})=>{if(!t){const o=(e?n:n.map(u=>encodeURIComponent(u))).join(te(a));switch(a){case"label":return`.${o}`;case"matrix":return`;${r}=${o}`;case"simple":return o;default:return`${r}=${o}`}}const c=ee(a),s=n.map(o=>a==="label"||a==="simple"?e?o:encodeURIComponent(o):U({allowReserved:e,name:r,value:o})).join(c);return a==="label"||a==="matrix"?c+s:s},U=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},D=({allowReserved:e,explode:t,name:r,style:a,value:n,valueOnly:c})=>{if(n instanceof Date)return c?n.toISOString():`${r}=${n.toISOString()}`;if(a!=="deepObject"&&!t){let u=[];Object.entries(n).forEach(([h,d])=>{u=[...u,h,e?d:encodeURIComponent(d)]});const l=u.join(",");switch(a){case"form":return`${r}=${l}`;case"label":return`.${l}`;case"matrix":return`;${r}=${l}`;default:return l}}const s=re(a),o=Object.entries(n).map(([u,l])=>U({allowReserved:e,name:a==="deepObject"?`${r}[${u}]`:u,value:l})).join(s);return a==="label"||a==="matrix"?s+o:o},ne=/\{[^{}]+\}/g,ae=({path:e,url:t})=>{let r=t;const a=t.match(ne);if(a)for(const n of a){let c=!1,s=n.substring(1,n.length-1),o="simple";s.endsWith("*")&&(c=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),o="label"):s.startsWith(";")&&(s=s.substring(1),o="matrix");const u=e[s];if(u==null)continue;if(Array.isArray(u)){r=r.replace(n,O({explode:c,name:s,style:o,value:u}));continue}if(typeof u=="object"){r=r.replace(n,D({explode:c,name:s,style:o,value:u,valueOnly:!0}));continue}if(o==="matrix"){r=r.replace(n,`;${U({name:s,value:u})}`);continue}const l=encodeURIComponent(o==="label"?`.${u}`:u);r=r.replace(n,l)}return r},se=({baseUrl:e,path:t,query:r,querySerializer:a,url:n})=>{const c=n.startsWith("/")?n:`/${n}`;let s=(e??"")+c;t&&(s=ae({path:t,url:s}));let o=r?a(r):"";return o.startsWith("?")&&(o=o.substring(1)),o&&(s+=`?${o}`),s};function ie(e){const t=e.body!==void 0;
5if(t&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}const oe=async(e,t)=>{const r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r},$=({allowReserved:e,array:t,object:r}={})=>n=>{const c=[];if(n&&typeof n=="object")for(const s in n){const o=n[s];if(o!=null)if(Array.isArray(o)){const u=O({allowReserved:e,explode:!0,name:s,style:"form",value:o,...t});u&&c.push(u)}else if(typeof o=="object"){const u=D({allowReserved:e,explode:!0,name:s,style:"deepObject",value:o,...r});u&&c.push(u)}else{const u=U({allowReserved:e,name:s,value:o});u&&c.push(u)}}return c.join("&")},ce=e=>{if(!e)return"stream";const t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>{if(t)return t;switch(e){case"arrayBuffer":case"blob":case"json":case"text":case"stream":return e;default:return}},le=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):!1,de=async({security:e,...t})=>{for(const r of e){if(le(t,r.name))continue;const a=await oe(r,t.auth);if(!a)continue;const n=r.name??"Authorization";switch(r.in){case"query":t.query||(t.query={}),t.query[n]=a;break;case"cookie":t.headers.append("Cookie",`${n}=${a}`);break;default:t.headers.set(n,a);break}}},N=e=>se({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:$(e.querySerializer),url:e.url}),P=(e,t)=>{const r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=L(e.headers,t.headers),r},fe=e=>{const t=[];return e.forEach((r,a)=>{t.push([a,r])}),t},L=(...e)=>{const t=new Headers;for(const r of e){if(!r)continue;const a=r instanceof Headers?fe(r):Object.entries(r);for(const[n,c]of a)if(c===null)t.delete(n);else if(Array.isArray(c))for(const s of c)t.append(n,s);else c!==void 0&&t.set(n,typeof c=="object"?JSON.stringify(c):c)}return t},he=e=>e==null||typeof e=="string"||typeof URLSearchParams<"u"&&e instanceof URLSearchParams||typeof Uint8Array<"u"&&e instanceof Uint8Array||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof Blob<"u"&&e instanceof Blob||typeof FormData<"u"&&e instanceof FormData?!0:(typeof ReadableStream<"u"&&e instanceof ReadableStream,!1),ye=(e,t,r)=>(r??"fields")==="data"?e:{data:e,...t},me=(e,t,r)=>(r??"fields")==="data"?void 0:{error:e,...t},pe=(e,t,r,a)=>({agent:e.agent,body:t,credentials:e.credentials,dispatcher:e.dispatcher,headers:e.headers,ignoreResponseError:e.ignoreResponseError??!0,method:e.method,onRequest:e.onRequest,onRequestError:e.onRequestError,onResponse:e.onResponse,onResponseError:e.onResponseError,parseResponse:e.parseResponse,query:void 0,responseType:r,retry:a??e.retry,retryDelay:e.retryDelay,retryStatusCodes:e.retryStatusCodes,signal:e.signal,timeout:e.timeout}),be=async(e,t,r)=>{if(r==="stream")return e.body;const a=(t.parseAs==="auto"?ce(e.headers.get("Content-Type")):t.parseAs)??"json";if(e.status===204||e.headers.get("Content-Length")==="0")switch(a){case"arrayBuffer":case"blob":case"text":return await e[a]();case"formData":return new FormData;case"stream":return e.body;default:return{}}let n=e._data;if(a==="formData"||typeof n>"u")switch(a){case"arrayBuffer":case"blob":case"formData":case"text":n=await e[a]();break;case"json":{await e.clone().text()?n=await e.json():n={};break}case"stream":return e.body}return a==="json"&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),n},we=async e=>{let t=e._data;if(typeof t>"u"){const r=await e.text();try{t=JSON.parse(r)}catch{t=r}}return t??{}};class k{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){const r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null)}exists(t){const r=this.getInterceptorIndex(t);return!!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){const a=this.getInterceptorIndex(t);return this.fns[a]?(this.fns[a]=r,t):!1}
5use(t){return this.fns.push(t),this.fns.length-1}}const ge=()=>({error:new k,request:new k,response:new k}),Se=$({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Ie={"Content-Type":"application/json"},W=(e={})=>({...Z,headers:Ie,ignoreResponseError:!0,parseAs:"auto",querySerializer:Se,...e}),Re=(e={})=>{let t=P(W(),e);const r=()=>({...t}),a=d=>(t=P(t,d),r()),n=ge(),c=async d=>{const i={...t,...d,headers:L(t.headers,d.headers),serializedBody:void 0};if(i.security&&await de({...i,security:i.security}),i.requestValidator&&await i.requestValidator(i),i.body!==void 0&&i.bodySerializer&&(i.serializedBody=i.bodySerializer(i.body)),(i.body===void 0||i.serializedBody==="")&&i.headers.delete("Content-Type"),i.body!==void 0&&i.bodySerializer===null&&(i.headers.get("Content-Type")||"").toLowerCase()==="application/json"){const y=i.body;if(typeof FormData<"u"&&y instanceof FormData)i.headers.delete("Content-Type");else if(typeof URLSearchParams<"u"&&y instanceof URLSearchParams)i.headers.set("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");else if(typeof Blob<"u"&&y instanceof Blob){const p=y.type?.trim();p?i.headers.set("Content-Type",p):i.headers.delete("Content-Type")}}const f=ie(i),w=N(i);return{networkBody:f,opts:i,url:w}},s=async(d,i)=>{for(const f of n.request.fns)f&&(d=await f(d,i));return i.headers=d.headers,i.method=d.method,i.signal=d.signal,d},o=(d,i,f)=>{const w=he(i)?d.retry:0;return pe(d,i,f,w)},u=async d=>{const{networkBody:i,opts:f,url:w}=await c(d),y=ue(f.parseAs,f.responseType),p=f.ofetch??K,R=i,A={body:R,headers:f.headers,method:f.method,redirect:"follow",signal:f.signal};let m=new Request(w,A);m=await s(m,f);const _=m.url,q=o(f,R,y);let b=await p.raw(_,q);for(const I of n.response.fns)I&&(b=await I(b,m,f));const C={request:m,response:b};if(b.ok){const I=await be(b,f,y);return ye(I,C,f.responseStyle)}let S=await we(b);for(const I of n.error.fns)I&&(S=await I(S,b,m,f));if(S=S||{},f.throwOnError)throw S;return me(S,C,f.responseStyle)},l=d=>i=>u({...i,method:d}),h=d=>async i=>{const{networkBody:f,opts:w,url:y}=await c(i),p={...w};return delete p.body,X({...p,fetch:w.fetch,headers:w.headers,method:d,onRequest:async(R,A)=>{let m=new Request(R,A);return m=await s(m,w),m},serializedBody:f,signal:w.signal,url:y})};return{buildUrl:N,connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),getConfig:r,head:l("HEAD"),interceptors:n,options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),request:u,setConfig:a,sse:{connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),head:h("HEAD"),options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("PUT"),trace:h("TRACE")},trace:l("TRACE")}},H=Re(W({baseUrl:"http://api.channelhaus.com.au/v2"})),Ee=e=>(e.client??H).post({url:"/v2/public/payment-requests",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(e.client??H).post({url:"/v2/public/payment-requests/{request_id}",...e,headers:{"Content-Type":"application/json",...e.headers}});var je={production:"https://api.cadiz3.com.au",beta:"https://api.beta.cadiz3.com.au"};function _e(e){return e.replace(/\/$/,"")}function Ce(e){return _e(e).replace(/\/v2$/,"")}function F(e){const t=Ce(e.apiBase),r={paymentRequestBase:t,resourceBase:`${t}/v2`};return"client"in e&&e.client&&(r.client=e.client),r}var j="ecn_checkout_state";function Te(e){try{sessionStorage.setItem(j,JSON.stringify(e))}catch{}}function qe(){try{const e=sessionStorage.getItem(j);return e?JSON.parse(e):null}catch{return null}}function Ue(){try{sessionStorage.removeItem(j)}catch{}}var V="payment",J="returning";async function ve(e,t){const{client:r,paymentRequestBase:a}=F(e),{data:n,error:c}=await Ee({client:r,baseUrl:a,body:{account_number:t.accountNumber,invoice_number:t.invoiceNumber,return_url:e.returnUrl}});if(c||!n){const s=c?.message||c?.error||"Invoice validation failed";throw new Error(s)}return{requestId:String(n.request_id||""),checkoutId:String(n.checkout_id||""),redirectUrl:String(n.redirect_url||""),totalInc:Number(n.total_inc)||0,amountDueInc:Number(n.amount_due_inc)||0,currency:String(n.currency||"AUD"),expiresAt:n.expires_at?String(n.expires_at):null}}function xe(e,t,r){if(!e.redirectUrl)throw new Error("Missing redirect URL from checkout session");Te({requestId:e.requestId,checkoutId:e.checkoutId,invoiceNumber:t,accountNumber:r,totalInc:e.totalInc,amountDueInc:e.amountDueInc,currency:e.currency}),window.location.href=e.redirectUrl}async function ze(e,t){const{client:r,paymentRequestBase:a}=F(typeof e=="string"?{apiBase:e}:e),{data:n,error:c}=await Ae({client:r,baseUrl:a,path:{request_id:t.requestId},body:{checkout_id:t.checkoutId,payment_amount_inc:t.paymentAmountInc,fee_amount_inc:t.feeAmountInc??0,send_receipt:t.sendReceipt??!0,currency:t.currency??"AUD"}});if(c||!n){const l=c?.message||c?.error||"Payment failed";throw new Error(l)}Ue();const s=n,o=s.invoices,u=Array.isArray(o)?o.map(l=>({invoiceNumber:String(l.invoice_number||""),paymentAmountInc:Number(l.payment_amount_inc)||0,appliedCreditAmountInc:Number(l.applied_credit_amount_inc)||0,totalInc:Number(l.total_inc)||0,amountDueInc:Number(l.amount_due_inc)||0})):[];return{receiptNumber:String(s.receipt_number||""),paymentAmountInc:Number(s.payment_amount_inc)||0,feeAmountInc:Number(s.fee_amount_inc)||0,appliedCreditAmountInc:Number(s.applied_credit_amount_inc)||0,currency:String(s.currency||"AUD"),invoices:u}}function Be(){try{return new URLSearchParams(window.location.search).get(V)===J}catch{return!1}}function Ne(e){const t=new URL(e||window.location.href);return t.searchParams.set(V,J),t.toString()}export{je as A,Ne as b,Ue as c,ze as f,qe as g,Be as i,xe as r,ve as v};

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.