PageSourceSearch

https://clients.forwarddesigner.net/assets/useFetch-BoJLT2pS.js

js forwarddesigner.net collected 2026-09-26 15:58:23 UTC 12,052 bytes, 7 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`3fb85819`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`fe96d17f-1c56-48ef-999b-35665c60a21f`,e._sentryDebugIdIdentifier=`sentry-dbid-fe96d17f-1c56-48ef-999b-35665c60a21f`)}catch{}})();import{s as e,t}from"./react-BxJ5vIog.js";import{t as n}from"./src-jTF5SSYo.js";import{t as r}from"./jsx-runtime-_Lj106d5.js";import{t as i}from"./compiler-runtime-BQBjb8-F.js";import{t as a}from"./cjs-Cq0NLgp1.js";var o=e(t(),1),s=r(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d=i(),f=function(e){return e.ACCOUNT=`account`,e.ACTIVE_TEMPLATE=`active-template`,e.ACCOUNTS_LIST=`accounts-list`,e.AGGREGATED_AVAILABILITY_EXCEPTIONS=`aggregated-availability-exceptions`,e.ANSWER_GROUP=`answer-group`,e.ANSWER_GROUP_BY_ID=`answer-group-by-id`,e.AVAILABILITY_SETTINGS_PUBLIC=`availability-settings-public`,e.BOOKING_PACKAGES=`booking-packages`,e.EVENT_MESSAGE=`event-message`,e.FREELANCER_BRAND_COLOR=`freelancer-brand-color`,e.FREELANCER_PUBLIC_PROFILE=`freelancer-public-profile`,e.GALLERY_IMAGE_LIKES_LIST=`gallery-image-likes-list`,e.GALLERY_DOWNLOADS_LIST=`gallery-downloads-list`,e.GOOGLE_FONTS=`google-fonts`,e.INBOUND_MESSAGE=`inbound-message`,e.LEAD_ACTIVITIES_LIST=`lead-activities-list`,e.LOADER_PUBLIC_ACCOUNT=`loader-public-account`,e.PUBLIC_ACCOUNT=`public-account`,e.PUBLIC_CUSTOM_FONTS=`public-custom-fonts`,e.PUBLIC_QUESTIONNAIRE=`public-questionnaire`,e.SELECTED_FREELANCER_ID=`selected-freelancer-id`,e.TIMEZONES_LIST=`timezones-list`,e.USER_ME=`user-me`,e.USER_PROFILE=`user-profile`,e.WIDGET_VERSION=`widget-version`,e.LATEST_VERSION=`latest-version`,e.PAGE_LOAD_VERSION=`page-load-version`,e.PROJECT_ACTIVITIES_LIST=`project-activities-list`,e}({}),p=function(e){return e.ABORT=`abort`,e.ERROR=`error`,e.IDLE=`idle`,e.PENDING=`pending`,e.SUCCESS=`success`,e}({}),m=new Set([`authorization`,`cookie`]);function h(e){return e?Object.fromEntries([...new Headers(e).entries()].map(([e,t])=>[e,m.has(e)?`[redacted]`:t])):{}}function g(e){try{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n=new URL(t);return{hostname:n.hostname,href:t,port:n.port||(n.protocol===`https:`?`443`:`80`),protocol:n.protocol}}catch{return{href:typeof e==`string`?e:e instanceof URL?e.href:e.url}}}function _(e){if(!(e instanceof Error))return{error:e};let t=`cause`in e?e.cause:void 0;return{cause:typeof t==`object`&&t?{address:`address`in t?t.address:void 0,code:`code`in t?t.code:void 0,errno:`errno`in t?t.errno:void 0,message:t instanceof Error?t.message:void 0,port:`port`in t?t.port:void 0,syscall:`syscall`in t?t.syscall:void 0}:t,message:e.message,name:e.name}}function v(e){let{status:t,url:n,xUrl:r}=e;return!(t===401&&r?.includes(`/api/public-galleries`)||t===403||t===404&&n?.includes(`/api/public-accounts/`))}async function y(e,t,n){let r;try{return r=await fetch(e,t),r.ok||v({status:r.status,url:e,xUrl:n})&&console.error(`❌ ~ file: index.ts:18 ~ safeFetch ~ response is not ok`,`
2`,`x-url:`,n,`
3`,`status:`,r.status,`
4`,`statusText:`,r.statusText,`
5`,`typeof init?.headers`,typeof t?.headers,`
6`,`❌ ~ file: index.ts:18 ~ safeFetch ~ request arguments`,JSON.stringify({request:{headers:h(t?.headers),method:t?.method},target:g(e),url:e},null,2)),r.status===200?await r.json():r}catch(t){return console.error(`❌ safeFetch transport failure`,{error:_(t),httpStatus:r?.status??null,reachedHttp:!!r,target:g(e),xUrl:n}),t?.store?.state?.values&&console.log(`🚨 ~ error.store.state:`,t.store.state.values),{error:t,status:p.ERROR}}}var b=e(a(),1);function x(e){let t=(0,d.c)(2),n=(0,o.useRef)(e||!1),r,i;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>(n.current=!0,()=>{n.current=!1}),i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),(0,o.useEffect)(r,i),n}function S(e){let t=(0,d.c)(5),n=x(),[r,i]=(0,o.useState)(e),a;t[0]===n?a=t[1]:(a=e=>{n.current&&i(e)},t[0]=n,t[1]=a);let s=a,c;return t[2]!==s||t[3]!==r?(c=[r,s],t[2]=s,t[3]=r,t[4]=c):c=t[4],c}function C(){return typeof window>`u`?{profileId:``,userId:``}:`bloomSettings`in window?window.bloomSettings:`picrSettings`in window?window.picrSettings:{profileId:``,userId:``}}function w(e){let t=!1;return n=>{t||=(window.requestAnimationFrame?window.requestAnimationFrame(()=>{e(n),t=!1}):setTimeout(()=>{e(n),t=!1},66),!0)}}var T=()=>new Promise((e,t)=>
6{let n;function r(){n||a(t),n=!1}function i(){n&&a(e),n=!0}function a(e){document.removeEventListener(`mousedown`,r),document.removeEventListener(`mousemove`,i),e()}document.addEventListener(`mousedown`,r),document.addEventListener(`mousemove`,i)}),E=typeof navigator>`u`?`SSR`:navigator.userAgent;function D(e=E){let t=!!/Opera Mini/i.exec(e),n=!!/IEMobile/i.exec(e),r=!!/SSR/i.exec(e),i=!!/Android/i.exec(e),a=!!/CriOS/i.exec(e),o=!!/iPhone|iPad|iPod|iOS|iPad Simulator|iPhone Simulator|iPod Simulator/i.exec(e),s=i||o||t||n||typeof window<`u`&&window.innerWidth<768,c=!s&&r;function l(){return e.match(/safari/gi)?!e.match(/chrome/gi):!1}return{isAndroid:i,isChromeIos:a,isDesktop:c,isIos:o,isMobile:s,isSafari:l(),isSSR:r}}function O(e,t){return e||`${t||n.NEXT_PUBLIC_DEMO_SUBDOMAIN}.${n.NEXT_PUBLIC_DOMAIN}`}function k(e){return e?.settings?O(e.settings.domain,e.settings.customUrl):O(``,``)}function A(e){return`https://${k(e)}`}function j(){if(typeof window>`u`)return``;if(n.NEXT_PUBLIC_SUBDOMAIN_OVERRIDE)return n.NEXT_PUBLIC_SUBDOMAIN_OVERRIDE;let{host:e}=window.location;return e.includes(`.bloom.io`)?e.split(`.`)[0]||``:e}function M(e,t,n){let r;if(n===void 0){let e=new Date;e.setMonth(e.getMonth()+1),r=`expires=${e.toUTCString()};`}else r=`expires=${n};`;let{hostname:i}=window.location,a=i.replace(/^www/,``);i.includes(`.picr.com`)?a=`.picr.com`:i.includes(`.bloom.io`)&&(a=`.bloom.io`),document.cookie=`${e}=${t}; domain=${a}; path=/; ${r}`}function N(e,t){let n=t??(typeof document>`u`?``:document.cookie),r=`${e}=([^;]+)(?:;|$)`,[,i=``]=new RegExp(r).exec(n)||[];return i||``}function P(e){let t=new Date;t.setMonth(t.getMonth()-1),M(e,``,t.toUTCString())}function F(){return typeof window<`u`&&(window.matchMedia&&(window.matchMedia(`only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)`).matches||window.matchMedia(`only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)`).matches)||window.devicePixelRatio&&window.devicePixelRatio>1.3)}function I(e){return window.open(e,`_blank`,`location=yes,height=570,width=520,scrollbars=yes,status=yes`)}function L(e){let t=document.createElement(`a`);document.body.appendChild(t),t.style=`display: none`,t.href=e,t.target=`_blank`,t.click(),document.body.removeChild(t)}function R(){return typeof window<`u`&&window.navigator&&window.navigator.language&&window.navigator.language!==`en-US`}function z(){let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform}function B(e){try{let{top:t}=window;if(t){t.location.href=e;return}}catch{}window.location.href=e}function V(e=`body`){let t=`--scrollbar-width`,n=document.querySelector(e);if(!n)return()=>{};let r=z(),i=D().isIos||r===`MacIntel`&&navigator.maxTouchPoints>1,a=n.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,s=window.innerWidth-document.documentElement.clientWidth,c=document.documentElement.scrollLeft??window.scrollX,l=document.documentElement.scrollTop??window.scrollY;if(a.overflow=`hidden`,a.maxHeight=`100svh`,a.setProperty(t,`${s}px`),n.scrollTo({left:c,top:l}),s&&(a[o]=`${s}px`),i){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(a,{left:`${-(c-Math.floor(e))}px`,position:`fixed`,right:`0`,top:`${-(l-Math.floor(t))}px`})}return()=>{Object.assign(a,{maxHeight:``,overflow:``,[o]:``}),a.removeProperty(t),i&&Object.assign(a,{left:``,position:``,right:``,top:``}),window.scrollTo(c,l)}}function H(e,t=``){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,r.style.display=`none`,document.body.appendChild(r),r.click(),document.body.removeChild(r),requestAnimationFrame(()=>{URL.revokeObjectURL(n)})}function U(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r==`object`&&r?t[n]=U(r):r!==void 0&&(t[n]=r)}),t}function W(e,t){let n=/filename\*=UTF-8''(?<lintGroup29>[^;\n]+)/i.exec(e)?.[1];if(n)try{return decodeURIComponent(n)}catch{return n}return/filename[^;=\n]*=(?<lintGroup30>['"]?)(?<lintGroup31>[^'";\n]*)\1/i.exec(e)?.[2]||t}var G={error:{message:`You are not allowed to perform this action`,status:403},status:p.ERROR};p.ERROR;function K(e=!0){let t=N(`bloom_token`);return{headers:{Accept:e?`application/vnd.bloom.v3`:`application/json`,"Content-Type":`application/json`,...t&&{Authorization:`bearer ${t}`}},method:`GET`,mode:`cors`}}async function q(e,t={}){let r=U((0,b.default)(K(),{...t})),i=t.headers||{};
6Object.entries(i).forEach(([e,t])=>{t===void 0&&e in i&&delete i[e]}),t?.headers===null&&delete r.headers;try{let[i=``]=e.split(`?`),a=!i.startsWith(`http`)&&!i.includes(`bloom.io`)?`${n.NEXT_PUBLIC_BLOOM_API}${e}`:e,o=await fetch(a,{...r,signal:t.signal});return o.ok?{data:r.method===`DELETE`?null:await o.json(),status:p.SUCCESS}:{error:await o.json(),status:p.ERROR}}catch(e){return{error:e,status:p.ERROR}}}function J(){let e=(0,d.c)(27),t=l(),r;e[0]===t?r=e[1]:(r=t.getQueryData([f.USER_ME]),e[0]=t,e[1]=r);let i=r,[a,o]=S(p.IDLE),s;e[2]===o?s=e[3]:(s=async(e,t)=>{let r=t===void 0?``:t;o(p.PENDING);try{let t=e.startsWith(`http`)?e:`${n.NEXT_PUBLIC_BLOOM_API}${e}`,i={...K(t.startsWith(n.NEXT_PUBLIC_BLOOM_API))},a=await fetch(t,(0,b.default)(i,{headers:{...e.startsWith(`http`)&&{Accept:`application/json`}}}));if(a.ok){let e=a.headers.get(`Content-Type`)??``;if(e.includes(`text/csv`)&&H(await a.blob(),r),e.includes(`application/pdf`)){let e=W(a.headers.get(`Content-Disposition`)||``,r);H(await a.blob(),e)}return o(p.SUCCESS),{data:void 0,status:p.SUCCESS}}return o(p.ERROR),{error:await a.json(),status:p.ERROR}}catch(e){let t=e;return o(p.ERROR),{error:t,status:p.ERROR}}},e[2]=o,e[3]=s);let c=s,u=C(),m;e[4]!==i?.defaultAccountId||e[5]!==t||e[6]!==o||e[7]!==u.profileId?(m=async(e,n)=>{let r=n===void 0?{}:n;o(p.PENDING);let[a]=e.split(`?`),s=a===void 0?``:a,c=!s.startsWith(`http`)&&!s.includes(`bloom.io`),l=t.getQueryData([f.SELECTED_FREELANCER_ID]),d=t.getQueryData([f.LOADER_PUBLIC_ACCOUNT]),m=i?.defaultAccountId||l||d?.id||u.profileId,h=await q(e,{...(0,b.default)(K(c),{...c&&m&&{headers:{"x-account":m}},...r}),signal:r.signal});return o(h.status),h},e[4]=i?.defaultAccountId,e[5]=t,e[6]=o,e[7]=u.profileId,e[8]=m):m=e[8],i?.defaultAccountId;let h=m,g;e[9]===h?g=e[10]:(g=e=>h(e,{method:`DELETE`}),e[9]=h,e[10]=g);let _=g,v;e[11]===h?v=e[12]:(v=(e,t)=>h(e,{method:`GET`,...t}),e[11]=h,e[12]=v);let y=v,x;e[13]===h?x=e[14]:(x=(e,t,n)=>h(e,{body:JSON.stringify(t),method:`PATCH`,...n}),e[13]=h,e[14]=x);let w=x,T;e[15]===h?T=e[16]:(T=(e,t,n)=>h(e,{body:JSON.stringify(t),method:`PUT`,...n}),e[15]=h,e[16]=T);let E=T,D;e[17]===h?D=e[18]:(D=(e,t,n)=>h(e,{body:JSON.stringify(t),method:`POST`,...n}),e[17]=h,e[18]=D);let O=D,k;return e[19]!==_||e[20]!==c||e[21]!==y||e[22]!==w||e[23]!==O||e[24]!==E||e[25]!==a?(k={download:c,get:y,handleDelete:_,patch:w,post:O,put:E,status:a},e[19]=_,e[20]=c,e[21]=y,e[22]=w,e[23]=O,e[24]=E,e[25]=a,e[26]=k):k=e[26],k}export{y as C,l as E,p as S,u as T,L as _,P as a,w as b,N as c,A as d,O as f,I as g,R as h,J as i,j as l,T as m,q as n,D as o,F as p,K as r,V as s,G as t,k as u,B as v,f as w,x,M as y};
7//# sourceMappingURL=useFetch-BoJLT2pS.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.