shopify 3.93.2 → 3.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-Bm_GpKQW.js +51 -0
  2. package/dist/assets/dev-console/index.html +1 -1
  3. package/dist/assets/hydrogen/starter/CHANGELOG.md +0 -64
  4. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +2 -4
  5. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +3 -6
  6. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +23 -117
  7. package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
  8. package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +4 -24
  9. package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +1 -1
  10. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +53 -14
  11. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +4 -11
  12. package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +1 -1
  13. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +2 -2
  14. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -1
  15. package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +14 -0
  16. package/dist/assets/hydrogen/starter/package.json +5 -5
  17. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +11 -0
  18. package/dist/assets/hydrogen/starter/vite.config.ts +1 -1
  19. package/dist/assets/hydrogen/vite/vite.config.js +1 -1
  20. package/dist/chunk-52KHWFYF.js +1 -0
  21. package/dist/chunk-7F3HZJH4.js +3 -0
  22. package/dist/{chunk-4VZV4LQX.js → chunk-7JFIBCHH.js} +66 -66
  23. package/dist/{chunk-MX6WWR5F.js → chunk-AQOYGO3U.js} +16 -16
  24. package/dist/{chunk-IG47ZDRU.js → chunk-DBDY2YEY.js} +1 -1
  25. package/dist/chunk-DEW5QFGH.js +415 -0
  26. package/dist/chunk-FU2Y2M3M.js +5 -0
  27. package/dist/chunk-JBSYWYIP.js +2 -0
  28. package/dist/chunk-QYR5VPQA.js +4 -0
  29. package/dist/{chunk-5FCKEHCK.js → chunk-R6N4NGU6.js} +154 -154
  30. package/dist/{chunk-XVFYDYZA.js → chunk-SVA22NZQ.js} +209 -211
  31. package/dist/cli/commands/config/autoupgrade/constants.d.ts +5 -0
  32. package/dist/cli/commands/config/autoupgrade/constants.js +6 -0
  33. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -0
  34. package/dist/cli/commands/config/autoupgrade/off.js +22 -0
  35. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -0
  36. package/dist/cli/commands/config/autoupgrade/on.js +22 -0
  37. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -0
  38. package/dist/cli/commands/config/autoupgrade/status.js +30 -0
  39. package/dist/cli/commands/docs/generate.d.ts +1 -1
  40. package/dist/cli/commands/docs/generate.js +6 -3
  41. package/dist/cli/commands/upgrade.js +3 -1
  42. package/dist/cli/services/kitchen-sink/static.js +1 -1
  43. package/dist/configs/all.yml +3 -0
  44. package/dist/configs/recommended.yml +3 -0
  45. package/dist/data/filters.json +30 -0
  46. package/dist/data/objects.json +17 -1
  47. package/dist/data/setting.json +25 -0
  48. package/dist/data/shopify_system_translations.json +29 -6
  49. package/dist/error-handler-JHFQZGYG.js +1 -0
  50. package/dist/hooks/postrun.js +1 -1
  51. package/dist/hooks/prerun.js +1 -1
  52. package/dist/{http-proxy-node16-DSQMBVDI.js → http-proxy-node16-TTURN6MD.js} +1 -1
  53. package/dist/index.js +1117 -1121
  54. package/dist/lib-3WHF5XD3.js +1 -0
  55. package/dist/{local-WHQ3ZS4K.js → local-4PW2CHVR.js} +1 -1
  56. package/dist/{morph-Q32V442A.js → morph-DQREIZD2.js} +1 -1
  57. package/dist/node-package-manager-NTQEYCSE.js +1 -0
  58. package/dist/path-HUAU3YBW.js +1 -0
  59. package/dist/tsconfig.tsbuildinfo +1 -1
  60. package/dist/{ui-GZ7DOSHP.js → ui-7Z2HOOEO.js} +1 -1
  61. package/dist/{workerd-LJU6AVMQ.js → workerd-VL54JTEU.js} +1 -1
  62. package/oclif.manifest.json +65 -4
  63. package/package.json +8 -7
  64. package/dist/assets/dev-console/extensions/dev-console/assets/index-BnXVL6nA.js +0 -78
  65. package/dist/chunk-4QL77VYJ.js +0 -415
  66. package/dist/chunk-DDTYWTF2.js +0 -1
  67. package/dist/chunk-FYQIRCLV.js +0 -5
  68. package/dist/chunk-NOSKVZWJ.js +0 -2
  69. package/dist/chunk-QJEBL3WX.js +0 -4
  70. package/dist/cli/commands/store/auth.d.ts +0 -15
  71. package/dist/cli/commands/store/auth.js +0 -46
  72. package/dist/cli/commands/store/execute.d.ts +0 -21
  73. package/dist/cli/commands/store/execute.js +0 -89
  74. package/dist/cli/services/store/auth/callback.d.ts +0 -8
  75. package/dist/cli/services/store/auth/callback.js +0 -140
  76. package/dist/cli/services/store/auth/config.d.ts +0 -6
  77. package/dist/cli/services/store/auth/config.js +0 -15
  78. package/dist/cli/services/store/auth/existing-scopes.d.ts +0 -5
  79. package/dist/cli/services/store/auth/existing-scopes.js +0 -40
  80. package/dist/cli/services/store/auth/index.d.ts +0 -18
  81. package/dist/cli/services/store/auth/index.js +0 -88
  82. package/dist/cli/services/store/auth/pkce.d.ts +0 -36
  83. package/dist/cli/services/store/auth/pkce.js +0 -49
  84. package/dist/cli/services/store/auth/recovery.d.ts +0 -4
  85. package/dist/cli/services/store/auth/recovery.js +0 -17
  86. package/dist/cli/services/store/auth/result.d.ts +0 -24
  87. package/dist/cli/services/store/auth/result.js +0 -39
  88. package/dist/cli/services/store/auth/scopes.d.ts +0 -4
  89. package/dist/cli/services/store/auth/scopes.js +0 -53
  90. package/dist/cli/services/store/auth/session-lifecycle.d.ts +0 -3
  91. package/dist/cli/services/store/auth/session-lifecycle.js +0 -69
  92. package/dist/cli/services/store/auth/session-store.d.ts +0 -32
  93. package/dist/cli/services/store/auth/session-store.js +0 -127
  94. package/dist/cli/services/store/auth/token-client.d.ts +0 -40
  95. package/dist/cli/services/store/auth/token-client.js +0 -95
  96. package/dist/cli/services/store/execute/admin-context.d.ts +0 -11
  97. package/dist/cli/services/store/execute/admin-context.js +0 -41
  98. package/dist/cli/services/store/execute/admin-transport.d.ts +0 -6
  99. package/dist/cli/services/store/execute/admin-transport.js +0 -42
  100. package/dist/cli/services/store/execute/index.d.ts +0 -13
  101. package/dist/cli/services/store/execute/index.js +0 -22
  102. package/dist/cli/services/store/execute/request.d.ts +0 -21
  103. package/dist/cli/services/store/execute/request.js +0 -88
  104. package/dist/cli/services/store/execute/result.d.ts +0 -3
  105. package/dist/cli/services/store/execute/result.js +0 -29
  106. package/dist/cli/services/store/execute/targets.d.ts +0 -18
  107. package/dist/cli/services/store/execute/targets.js +0 -21
  108. package/dist/error-handler-GZ2I7BG5.js +0 -1
  109. package/dist/lib-GGVLMXY5.js +0 -1
  110. package/dist/node-package-manager-6XMPTNUI.js +0 -1
  111. package/dist/path-IT7KPARG.js +0 -1
@@ -1 +0,0 @@
1
- import{Da as F,a as s,sa as R}from"./chunk-4VZV4LQX.js";import{G as P,M as _,N as x,O as k,S as T,U as b,q as f,s as C,t as L}from"./chunk-MX6WWR5F.js";import{Bd as l,Cb as $,Eb as V,Ed as r,Fd as m,Vc as W,Yc as v,ad as G,lb as I,mb as E,nb as M,qb as g,rb as O,uc as N,wd as u,yc as J,yd as d}from"./chunk-4QL77VYJ.js";import{m as U,n as D,o as S}from"./chunk-NOSKVZWJ.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var H=e=>{let t=R();if(t){let n=e.id.includes("theme");Z(t,n)}};function Z(e,t){let a=`Upgrade to the latest CLI version by ${new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(e)}.`;N({headline:a,body:"This command requires an upgrade to continue working as intended.",nextSteps:[["Run",{command:"upgrade"},"to",{link:{label:"upgrade Shopify CLI",url:t?"https://shopify.dev/docs/themes/tools/cli#upgrade-shopify-cli":"https://shopify.dev/docs/apps/tools/cli#upgrade-shopify-cli"}}]]})}c();function Y(){let e=g();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function q(){let e=S()??D(),t=O(e),n=M();if(!n&&G()){l("Skipping upgrade in development mode.");return}if(n){let o=Y();if(!o)throw new Error("Could not determine the package manager");let[a,...p]=o.split(" ");if(!a)throw new Error("Could not determine the command to run");l(d`Upgrading Shopify CLI by running: ${u.genericShellCommand(o)}...`),await W(a,p,{stdio:"inherit"})}else if(t)await ee(t,s);else throw new Error("Could not determine the local project directory")}function B(){let e=s,t=k("@shopify/cli",e);if(!t){r("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return r("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),t;if(!C()){r("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(v()){r("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(I(e)){r("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return t}async function K(){if(v()||I(s)||C())return;let e=k("@shopify/cli",s);e&&await f("warn-on-available-upgrade",{days:1},async()=>{m(y(e))})}function y(e){let t=Y();return t?d`💡 Version ${e} available! Run ${u.genericShellCommand(t)}`.value:d`💡 Version ${e} available!`.value}async function Ie(){let e=await J({message:"Enable automatic updates for Shopify CLI?",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, I'll update manually"});return L(e),e}async function ee(e,t){let n=(await b(e)).content,o=n.dependencies??{},a=n.devDependencies??{},i={...o,...a}[await A()];if(!i){r("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}i.slice(0,1).match(/[\^~]/)&&(i=t);let h=await x(await A(),i);h?oe(i,h):ne(i),await j("prod",o,e),await j("dev",a,e)}async function j(e,t,n){let o=[await A(),...await te()].filter(p=>!!t[p]).map(p=>({name:p,version:"latest"})),a=await _(n);o.length>0&&await T(o,{packageManager:await P(n),type:e,directory:n,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:a})}async function A(){return(await z()).name}async function te(){return(await z())?.oclif?.plugins??[]}var w;async function z(){if(!w){let e=await b(U(import.meta.url));w=w??e.content}return w}function ne(e){l(d`You're on the latest version, ${u.yellow(e)}, no need to upgrade!`)}function oe(e,t){l(d`Upgrading CLI from ${u.yellow(e)} to ${u.yellow(t)}...`)}var X=!1;function Oe(){return X}var Pe=async({config:e,Command:t})=>{await re(t),await F({config:e,exitMode:"ok"}),H(t);let n=t.id.replace(/:/g," ");if(r(`Completed command ${n}`),X=!0,!t.id?.includes("upgrade")&&!t.id?.startsWith("notifications"))try{await ae()}catch(o){r(`Auto-upgrade check failed: ${o}`)}};async function ae(){let e=B();if(!e){await K();return}process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1"?await Q(e):await f("auto-upgrade",{days:1},async()=>{await Q(e)})}async function Q(e){if(E(s,e))return m(y(e));try{await q()}catch(t){let n=`Auto-upgrade failed: ${t}`;r(n),m(y(e));let{sendErrorToBugsnag:o}=await import("./error-handler-GZ2I7BG5.js"),a=Object.assign(new Error(n),{packageManager:g(),platform:process.platform,cliVersion:s});await o(a,"expected_error")}}async function re(e){let t=new Date().getTime();if(e&&Object.prototype.hasOwnProperty.call(e,"analyticsStopCommand")){let n=e.analyticsStopCommand();if(n){let{commandStartOptions:o}=$();if(!o)return;await V(()=>({commandStartOptions:{...o,startTime:t,startCommand:n}}))}}}export{q as a,Ie as b,Oe as c,Pe as d};
@@ -1,5 +0,0 @@
1
- import{a as R,c as y,g as C}from"./chunk-VPRTJUIN.js";var q=y((Re,D)=>{C();var w=1e3,v=w*60,x=v*60,b=x*24,re=b*7,te=b*365.25;D.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ne(e);if(r==="number"&&isFinite(e))return t.long?oe(e):se(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ne(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*te;case"weeks":case"week":case"w":return r*re;case"days":case"day":case"d":return r*b;case"hours":case"hour":case"hrs":case"hr":case"h":return r*x;case"minutes":case"minute":case"mins":case"min":case"m":return r*v;case"seconds":case"second":case"secs":case"sec":case"s":return r*w;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function se(e){var t=Math.abs(e);return t>=b?Math.round(e/b)+"d":t>=x?Math.round(e/x)+"h":t>=v?Math.round(e/v)+"m":t>=w?Math.round(e/w)+"s":e+"ms"}function oe(e){var t=Math.abs(e);return t>=b?T(e,t,b,"day"):t>=x?T(e,t,x,"hour"):t>=v?T(e,t,v,"minute"):t>=w?T(e,t,w,"second"):e+" ms"}function T(e,t,r,n){var a=t>=r*1.5;return Math.round(e/r)+" "+n+(a?"s":"")}});var k=y((Ae,G)=>{C();function ie(e){r.debug=r,r.default=r,r.coerce=H,r.disable=F,r.enable=a,r.enabled=Z,r.humanize=q(),r.destroy=K,Object.keys(e).forEach(s=>{r[s]=e[s]}),r.names=[],r.skips=[],r.formatters={};function t(s){let o=0;for(let i=0;i<s.length;i++)o=(o<<5)-o+s.charCodeAt(i),o|=0;return r.colors[Math.abs(o)%r.colors.length]}r.selectColor=t;function r(s){let o,i=null,l,O;function f(...p){if(!f.enabled)return;let g=f,E=Number(new Date),Q=E-(o||E);g.diff=Q,g.prev=o,g.curr=E,o=E,p[0]=r.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let I=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(N,X)=>{if(N==="%%")return"%";I++;let j=r.formatters[X];if(typeof j=="function"){let ee=p[I];N=j.call(g,ee),p.splice(I,1),I--}return N}),r.formatArgs.call(g,p),(g.log||r.log).apply(g,p)}return f.namespace=s,f.useColors=r.useColors(),f.color=r.selectColor(s),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(l!==r.namespaces&&(l=r.namespaces,O=r.enabled(s)),O),set:p=>{i=p}}),typeof r.init=="function"&&r.init(f),f}function n(s,o){let i=r(this.namespace+(typeof o>"u"?":":o)+s);return i.log=this.log,i}function a(s){r.save(s),r.namespaces=s,r.names=[],r.skips=[];let o=(typeof s=="string"?s:"").trim().replace(" ",",").split(",").filter(Boolean);for(let i of o)i[0]==="-"?r.skips.push(i.slice(1)):r.names.push(i)}function m(s,o){let i=0,l=0,O=-1,f=0;for(;i<s.length;)if(l<o.length&&(o[l]===s[i]||o[l]==="*"))o[l]==="*"?(O=l,f=i,l++):(i++,l++);else if(O!==-1)l=O+1,f++,i=f;else return!1;for(;l<o.length&&o[l]==="*";)l++;return l===o.length}function F(){let s=[...r.names,...r.skips.map(o=>"-"+o)].join(",");return r.enable(""),s}function Z(s){for(let o of r.skips)if(m(s,o))return!1;for(let o of r.names)if(m(s,o))return!0;return!1}function H(s){return s instanceof Error?s.stack||s.message:s}function K(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}G.exports=ie});var P=y((d,A)=>{C();d.formatArgs=ue;d.save=ae;d.load=le;d.useColors=ce;d.storage=fe();d.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ce(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ue(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+A.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(r++,a==="%c"&&(n=r))}),e.splice(n,0,t)}d.log=console.debug||console.log||(()=>{});function ae(e){try{e?d.storage.setItem("debug",e):d.storage.removeItem("debug")}catch{}}function le(){let e;try{e=d.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function fe(){try{return localStorage}catch{}}A.exports=k()(d);var{formatters:Ce}=A.exports;Ce.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Y=y((Le,U)=>{"use strict";C();U.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),a=t.indexOf("--");return n!==-1&&(a===-1||n<a)}});var V=y((ke,$)=>{"use strict";C();var de=R("os"),z=R("tty"),h=Y(),{env:c}=process,M;h("no-color")||h("no-colors")||h("color=false")||h("color=never")?M=0:(h("color")||h("colors")||h("color=true")||h("color=always"))&&(M=1);function pe(){if("FORCE_COLOR"in c)return c.FORCE_COLOR==="true"?1:c.FORCE_COLOR==="false"?0:c.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(c.FORCE_COLOR,10),3)}function he(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function me(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=pe();n!==void 0&&(M=n);let a=r?M:n;if(a===0)return 0;if(r){if(h("color=16m")||h("color=full")||h("color=truecolor"))return 3;if(h("color=256"))return 2}if(e&&!t&&a===void 0)return 0;let m=a||0;if(c.TERM==="dumb")return m;if(process.platform==="win32"){let F=de.release().split(".");return Number(F[0])>=10&&Number(F[2])>=10586?Number(F[2])>=14931?3:2:1}if("CI"in c)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(F=>F in c)||c.CI_NAME==="codeship"?1:m;if("TEAMCITY_VERSION"in c)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0;if(c.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in c){let F=Number.parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return F>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(c.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)||"COLORTERM"in c?1:m}function S(e,t={}){let r=me(e,{streamIsTTY:e&&e.isTTY,...t});return he(r)}$.exports={supportsColor:S,stdout:S({isTTY:z.isatty(1)}),stderr:S({isTTY:z.isatty(2)})}});var W=y((u,L)=>{C();var Fe=R("tty"),_=R("util");u.init=xe;u.log=Oe;u.formatArgs=ye;u.save=we;u.load=ve;u.useColors=ge;u.destroy=_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u.colors=[6,2,3,4,5,1];try{let e=V();e&&(e.stderr||e).level>=2&&(u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}u.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(a,m)=>m.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function ge(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:Fe.isatty(process.stderr.fd)}function ye(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,a="\x1B[3"+(n<8?n:"8;5;"+n),m=` ${a};1m${t} \x1B[0m`;e[0]=m+e[0].split(`
2
- `).join(`
3
- `+m),e.push(a+"m+"+L.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=be()+t+" "+e[0]}function be(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Oe(...e){return process.stderr.write(_.formatWithOptions(u.inspectOpts,...e)+`
4
- `)}function we(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function ve(){return process.env.DEBUG}function xe(e){e.inspectOpts={};let t=Object.keys(u.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=u.inspectOpts[t[r]]}L.exports=k()(u);var{formatters:J}=L.exports;J.o=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts).split(`
5
- `).map(t=>t.trim()).join(" ")};J.O=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts)}});var Ee=y((je,B)=>{C();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?B.exports=P():B.exports=W()});export{Y as a,V as b,Ee as c};
@@ -1,2 +0,0 @@
1
- import{a as $,c as R,e as S,g as l}from"./chunk-VPRTJUIN.js";var E=R((U,b)=>{l();var T=$("path");b.exports=function(e,n){if(n)var t=n.map(function(s){return T.resolve(e,s)});else var t=e;var r=t.slice(1).reduce(function(s,o){if(!o.match(/^([A-Za-z]:)?\/|\\/))throw new Error("relative path without a basedir");for(var a=o.split(/\/+|\\+/),i=0;s[i]===a[i]&&i<Math.min(s.length,a.length);i++);return s.slice(0,i)},t[0].split(/\/+|\\+/));return r.length>1?r.join("/"):"/"}});l();var j=S(E(),1);l();l();var w=/^[A-Za-z]:\//;function f(e=""){return e&&e.replace(/\\/g,"/").replace(w,n=>n.toUpperCase())}var I=/^[/\\]{2}/,N=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,A=/^[A-Za-z]:$/,z=/^\/([A-Za-z]:)?$/;var O=":",m=function(e){if(e.length===0)return".";e=f(e);let n=e.match(I),t=c(e),r=e[e.length-1]==="/";return e=v(e,!t),e.length===0?t?"/":r?"./":".":(r&&(e+="/"),A.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!c(e)?`/${e}`:e)},x=function(...e){if(e.length===0)return".";let n;for(let t of e)t&&t.length>0&&(n===void 0?n=t:n+=`/${t}`);return n===void 0?".":m(n.replace(/\/\/+/g,"/"))};function W(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}var u=function(...e){e=e.map(r=>f(r));let n="",t=!1;for(let r=e.length-1;r>=-1&&!t;r--){let s=r>=0?e[r]:W();!s||s.length===0||(n=`${s}/${n}`,t=c(s))}return n=v(n,!t),t&&!c(n)?`/${n}`:n.length>0?n:"."};function v(e,n){let t="",r=0,s=-1,o=0,a=null;for(let i=0;i<=e.length;++i){if(i<e.length)a=e[i];else{if(a==="/")break;a="/"}if(a==="/"){if(!(s===i-1||o===1))if(o===2){if(t.length<2||r!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let _=t.lastIndexOf("/");_===-1?(t="",r=0):(t=t.slice(0,_),r=t.length-1-t.lastIndexOf("/")),s=i,o=0;continue}else if(t.length>0){t="",r=0,s=i,o=0;continue}}n&&(t+=t.length>0?"/..":"..",r=2)}else t.length>0?t+=`/${e.slice(s+1,i)}`:t=e.slice(s+1,i),r=i-s-1;s=i,o=0}else a==="."&&o!==-1?++o:o=-1}return t}var c=function(e){return N.test(e)};var C=/.(\.[^./]+)$/,p=function(e){let n=C.exec(f(e));return n&&n[1]||""},h=function(e,n){let t=u(e).replace(z,"$1").split("/"),r=u(n).replace(z,"$1").split("/");if(r[0][1]===":"&&t[0][1]===":"&&t[0]!==r[0])return r.join("/");let s=[...t];for(let o of s){if(r[0]!==o)break;t.shift(),r.shift()}return[...t.map(()=>".."),...r].join("/")},d=function(e){let n=f(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&A.test(n[0])&&(n[0]+="/"),n.join("/")||(c(e)?"/":".")};var g=function(e,n){let t=f(e).split("/").pop();return n&&t.endsWith(n)?t.slice(0,-n.length):t},P=function(e){let n=f(e).split("/").shift()||"/",t=g(e),r=p(t);return{root:n,dir:d(e),base:t,ext:r,name:t.slice(0,t.length-r.length)}};import{fileURLToPath as D}from"url";function Y(...e){return x(...e)}function ee(e){return m(e)}function te(...e){return u(...e)}function ne(e,n){return h(e,n)}function L(e){return c(e)}function k(e){return d(e)}function re(e,n){return g(e,n)}function se(e){return p(e)}function oe(e){return P(e)}function ie(e,n=F()){let t=(0,j.default)([e,n]),r=h(n,e),s=r.split("/").filter(o=>o==="..").length;return t==="/"||r===""||s>2?e:r}function ae(e,n){let t=h(e,n);return!t.startsWith("..")&&!L(t)}function le(e){return k(D(e))}function F(){return m(process.env.INIT_CWD||process.cwd())}function ce(e=process.argv){let n=e.indexOf("--path");if(n===-1)return e.find(s=>s.startsWith("--path="))?.split("=")[1];let t=e[n+1];if(!(!t||t.startsWith("-")))return t}function fe(e=process.argv){return e.includes("--json")||e.includes("-j")}function ue(e,n){let t=e.replace(/\\/g,"/").split("/"),r=[],s=!1;for(let a of t)a===".."?(s=!0,r.pop()):a!=="."&&r.push(a);let o=r.join("/");return s&&n(`Warning: path '${e}' contains '..' traversal \u2014 sanitized to '${o||"."}'
2
- `),o}export{O as a,Y as b,ee as c,te as d,ne as e,L as f,k as g,re as h,se as i,oe as j,ie as k,ae as l,le as m,F as n,ce as o,fe as p,ue as q};
@@ -1,4 +0,0 @@
1
- import{a as xe,c as w,g as d}from"./chunk-VPRTJUIN.js";var Ge=w(oe=>{d();var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");oe.encode=function(r){if(0<=r&&r<Ne.length)return Ne[r];throw new TypeError("Must be between 0 and 63: "+r)};oe.decode=function(r){var e=65,n=90,t=97,o=122,i=48,u=57,l=43,s=47,a=26,c=52;return e<=r&&r<=n?r-e:t<=r&&r<=o?r-t+a:i<=r&&r<=u?r-i+c:r==l?62:r==s?63:-1}});var se=w(ue=>{d();var Ie=Ge(),ie=5,Pe=1<<ie,Te=Pe-1,je=Pe;function Lr(r){return r<0?(-r<<1)+1:(r<<1)+0}function Er(r){var e=(r&1)===1,n=r>>1;return e?-n:n}ue.encode=function(e){var n="",t,o=Lr(e);do t=o&Te,o>>>=ie,o>0&&(t|=je),n+=Ie.encode(t);while(o>0);return n};ue.decode=function(e,n,t){var o=e.length,i=0,u=0,l,s;do{if(n>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(s=Ie.decode(e.charCodeAt(n++)),s===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));l=!!(s&je),s&=Te,i=i+(s<<u),u+=ie}while(l);t.value=Er(i),t.rest=n}});var U=w(C=>{d();function Or(r,e,n){if(e in r)return r[e];if(arguments.length===3)return n;throw new Error('"'+e+'" is a required argument.')}C.getArg=Or;var Be=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ar=/^data:.+\,.+$/;function Q(r){var e=r.match(Be);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}C.urlParse=Q;function F(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}C.urlGenerate=F;function le(r){var e=r,n=Q(r);if(n){if(!n.path)return r;e=n.path}for(var t=C.isAbsolute(e),o=e.split(/\/+/),i,u=0,l=o.length-1;l>=0;l--)i=o[l],i==="."?o.splice(l,1):i===".."?u++:u>0&&(i===""?(o.splice(l+1,u),u=0):(o.splice(l,2),u--));return e=o.join("/"),e===""&&(e=t?"/":"."),n?(n.path=e,F(n)):e}C.normalize=le;function qe(r,e){r===""&&(r="."),e===""&&(e=".");var n=Q(e),t=Q(r);if(t&&(r=t.path||"/"),n&&!n.scheme)return t&&(n.scheme=t.scheme),F(n);if(n||e.match(Ar))return e;if(t&&!t.host&&!t.path)return t.host=e,F(t);var o=e.charAt(0)==="/"?e:le(r.replace(/\/+$/,"")+"/"+e);return t?(t.path=o,F(t)):o}C.join=qe;C.isAbsolute=function(r){return r.charAt(0)==="/"||Be.test(r)};function br(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var n=0;e.indexOf(r+"/")!==0;){var t=r.lastIndexOf("/");if(t<0||(r=r.slice(0,t),r.match(/^([^\/]+:\/)?\/*$/)))return e;++n}return Array(n+1).join("../")+e.substr(r.length+1)}C.relative=br;var Fe=(function(){var r=Object.create(null);return!("__proto__"in r)})();function De(r){return r}function Rr(r){return Ue(r)?"$"+r:r}C.toSetString=Fe?De:Rr;function xr(r){return Ue(r)?r.slice(1):r}C.fromSetString=Fe?De:xr;function Ue(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var n=e-10;n>=0;n--)if(r.charCodeAt(n)!==36)return!1;return!0}function Nr(r,e,n){var t=D(r.source,e.source);return t!==0||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0||n)||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=r.generatedLine-e.generatedLine,t!==0)?t:D(r.name,e.name)}C.compareByOriginalPositions=Nr;function Gr(r,e,n){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0||n)||(t=D(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:D(r.name,e.name)}C.compareByGeneratedPositionsDeflated=Gr;function D(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function Ir(r,e){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=D(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:D(r.name,e.name)}C.compareByGeneratedPositionsInflated=Ir;function Pr(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}C.parseSourceMapInput=Pr;function Tr(r,e,n){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),n){var t=Q(n);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var o=t.path.lastIndexOf("/");o>=0&&(t.path=t.path.substring(0,o+1))}e=qe(F(t),e)}return le(e)}C.computeSourceURL=Tr});var fe=w($e=>{d();var ae=U(),ce=Object.prototype.hasOwnProperty,P=typeof Map<"u";function x(){this._array=[],this._set=P?new Map:Object.create(null)}x.fromArray=function(e,n){for(var t=new x,o=0,i=e.length;o<i;o++)t.add(e[o],n);return t};x.prototype.size=function(){return P?this._set.size:Object.getOwnPropertyNames(this._set).length};x.prototype.add=function(e,n){var t=P?e:ae.toSetString(e),o=P?this.has(e):ce.call(this._set,t),i=this._array.length;(!o||n)&&this._array.push(e),o||(P?this._set.set(e,i):this._set[t]=i)};x.prototype.has=function(e){if(P)return this._set.has(e);var n=ae.toSetString(e);return ce.call(this._set,n)};x.prototype.indexOf=function(e){if(P){var n=this._set.get(e);if(n>=0)return n}else{var t=ae.toSetString(e);if(ce.call(this._set,t))return this._set[t]}throw new Error('"'+e+'" is not in the set.')};x.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};x.prototype.toArray=function(){return this._array.slice()};$e.ArraySet=x});var Qe=w(ke=>{d();var ze=U();function jr(r,e){var n=r.generatedLine,t=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return t>n||t==n&&i>=o||ze.compareByGeneratedPositionsInflated(r,e)<=0}function Y(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Y.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)};Y.prototype.add=function(e){jr(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Y.prototype.toArray=function(){return this._sorted||(this._array.sort(ze.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};ke.MappingList=Y});var he=w(Ve=>{d();var V=se(),m=U(),H=fe().ArraySet,Br=Qe().MappingList;function E(r){r||(r={}),this._file=m.getArg(r,"file",null),this._sourceRoot=m.getArg(r,"sourceRoot",null),this._skipValidation=m.getArg(r,"skipValidation",!1),this._sources=new H,this._names=new H,this._mappings=new Br,this._sourcesContents=null}E.prototype._version=3;E.fromSourceMap=function(e){var n=e.sourceRoot,t=new E({file:e.file,sourceRoot:n});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,n!=null&&(i.source=m.relative(n,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),t.addMapping(i)}),e.sources.forEach(function(o){var i=o;n!==null&&(i=m.relative(n,o)),t._sources.has(i)||t._sources.add(i);var u=e.sourceContentFor(o);u!=null&&t.setSourceContent(o,u)}),t};E.prototype.addMapping=function(e){var n=m.getArg(e,"generated"),t=m.getArg(e,"original",null),o=m.getArg(e,"source",null),i=m.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:o,name:i})};E.prototype.setSourceContent=function(e,n){var t=e;this._sourceRoot!=null&&(t=m.relative(this._sourceRoot,t)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[m.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[m.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};E.prototype.applySourceMap=function(e,n,t){var o=n;if(n==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=m.relative(i,o));var u=new H,l=new H;this._mappings.unsortedForEach(function(s){if(s.source===o&&s.originalLine!=null){var a=e.originalPositionFor({line:s.originalLine,column:s.originalColumn});a.source!=null&&(s.source=a.source,t!=null&&(s.source=m.join(t,s.source)),i!=null&&(s.source=m.relative(i,s.source)),s.originalLine=a.line,s.originalColumn=a.column,a.name!=null&&(s.name=a.name))}var c=s.source;c!=null&&!u.has(c)&&u.add(c);var v=s.name;v!=null&&!l.has(v)&&l.add(v)},this),this._sources=u,this._names=l,e.sources.forEach(function(s){var a=e.sourceContentFor(s);a!=null&&(t!=null&&(s=m.join(t,s)),i!=null&&(s=m.relative(i,s)),this.setSourceContent(s,a))},this)};E.prototype._validateMapping=function(e,n,t,o){if(n&&typeof n.line!="number"&&typeof n.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!o)){if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:o}))}};E.prototype._serializeMappings=function(){for(var e=0,n=1,t=0,o=0,i=0,u=0,l="",s,a,c,v,f=this._mappings.toArray(),g=0,M=f.length;g<M;g++){if(a=f[g],s="",a.generatedLine!==n)for(e=0;a.generatedLine!==n;)s+=";",n++;else if(g>0){if(!m.compareByGeneratedPositionsInflated(a,f[g-1]))continue;s+=","}s+=V.encode(a.generatedColumn-e),e=a.generatedColumn,a.source!=null&&(v=this._sources.indexOf(a.source),s+=V.encode(v-u),u=v,s+=V.encode(a.originalLine-1-o),o=a.originalLine-1,s+=V.encode(a.originalColumn-t),t=a.originalColumn,a.name!=null&&(c=this._names.indexOf(a.name),s+=V.encode(c-i),i=c)),l+=s}return l};E.prototype._generateSourcesContent=function(e,n){return e.map(function(t){if(!this._sourcesContents)return null;n!=null&&(t=m.relative(n,t));var o=m.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};E.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};E.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ve.SourceMapGenerator=E});var We=w(T=>{d();T.GREATEST_LOWER_BOUND=1;T.LEAST_UPPER_BOUND=2;function ge(r,e,n,t,o,i){var u=Math.floor((e-r)/2)+r,l=o(n,t[u],!0);return l===0?u:l>0?e-u>1?ge(u,e,n,t,o,i):i==T.LEAST_UPPER_BOUND?e<t.length?e:-1:u:u-r>1?ge(r,u,n,t,o,i):i==T.LEAST_UPPER_BOUND?u:r<0?-1:r}T.search=function(e,n,t,o){if(n.length===0)return-1;var i=ge(-1,n.length,e,n,t,o||T.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&t(n[i],n[i-1],!0)===0;)--i;return i}});var Xe=w(Je=>{d();function ve(r,e,n){var t=r[e];r[e]=r[n],r[n]=t}function qr(r,e){return Math.round(r+Math.random()*(e-r))}function de(r,e,n,t){if(n<t){var o=qr(n,t),i=n-1;ve(r,o,t);for(var u=r[t],l=n;l<t;l++)e(r[l],u)<=0&&(i+=1,ve(r,i,l));ve(r,i+1,l);var s=i+1;de(r,e,n,s-1),de(r,e,s+1,t)}}Je.quickSort=function(r,e){de(r,e,0,r.length-1)}});var Ke=w(ee=>{d();var h=U(),pe=We(),$=fe().ArraySet,Fr=se(),W=Xe().quickSort;function p(r,e){var n=r;return typeof r=="string"&&(n=h.parseSourceMapInput(r)),n.sections!=null?new O(n,e):new S(n,e)}p.fromSourceMap=function(r,e){return S.fromSourceMap(r,e)};p.prototype._version=3;p.prototype.__generatedMappings=null;Object.defineProperty(p.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});p.prototype.__originalMappings=null;Object.defineProperty(p.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});p.prototype._charIsMappingSeparator=function(e,n){var t=e.charAt(n);return t===";"||t===","};p.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")};p.GENERATED_ORDER=1;p.ORIGINAL_ORDER=2;p.GREATEST_LOWER_BOUND=1;p.LEAST_UPPER_BOUND=2;p.prototype.eachMapping=function(e,n,t){var o=n||null,i=t||p.GENERATED_ORDER,u;switch(i){case p.GENERATED_ORDER:u=this._generatedMappings;break;case p.ORIGINAL_ORDER:u=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;u.map(function(s){var a=s.source===null?null:this._sources.at(s.source);return a=h.computeSourceURL(l,a,this._sourceMapURL),{source:a,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn,originalLine:s.originalLine,originalColumn:s.originalColumn,name:s.name===null?null:this._names.at(s.name)}},this).forEach(e,o)};p.prototype.allGeneratedPositionsFor=function(e){var n=h.getArg(e,"line"),t={source:h.getArg(e,"source"),originalLine:n,originalColumn:h.getArg(e,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var o=[],i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",h.compareByOriginalPositions,pe.LEAST_UPPER_BOUND);if(i>=0){var u=this._originalMappings[i];if(e.column===void 0)for(var l=u.originalLine;u&&u.originalLine===l;)o.push({line:h.getArg(u,"generatedLine",null),column:h.getArg(u,"generatedColumn",null),lastColumn:h.getArg(u,"lastGeneratedColumn",null)}),u=this._originalMappings[++i];else for(var s=u.originalColumn;u&&u.originalLine===n&&u.originalColumn==s;)o.push({line:h.getArg(u,"generatedLine",null),column:h.getArg(u,"generatedColumn",null),lastColumn:h.getArg(u,"lastGeneratedColumn",null)}),u=this._originalMappings[++i]}return o};ee.SourceMapConsumer=p;function S(r,e){var n=r;typeof r=="string"&&(n=h.parseSourceMapInput(r));var t=h.getArg(n,"version"),o=h.getArg(n,"sources"),i=h.getArg(n,"names",[]),u=h.getArg(n,"sourceRoot",null),l=h.getArg(n,"sourcesContent",null),s=h.getArg(n,"mappings"),a=h.getArg(n,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);u&&(u=h.normalize(u)),o=o.map(String).map(h.normalize).map(function(c){return u&&h.isAbsolute(u)&&h.isAbsolute(c)?h.relative(u,c):c}),this._names=$.fromArray(i.map(String),!0),this._sources=$.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(c){return h.computeSourceURL(u,c,e)}),this.sourceRoot=u,this.sourcesContent=l,this._mappings=s,this._sourceMapURL=e,this.file=a}S.prototype=Object.create(p.prototype);S.prototype.consumer=p;S.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=h.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var n;for(n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==r)return n;return-1};S.fromSourceMap=function(e,n){var t=Object.create(S.prototype),o=t._names=$.fromArray(e._names.toArray(),!0),i=t._sources=$.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file,t._sourceMapURL=n,t._absoluteSources=t._sources.toArray().map(function(g){return h.computeSourceURL(t.sourceRoot,g,n)});for(var u=e._mappings.toArray().slice(),l=t.__generatedMappings=[],s=t.__originalMappings=[],a=0,c=u.length;a<c;a++){var v=u[a],f=new Ze;f.generatedLine=v.generatedLine,f.generatedColumn=v.generatedColumn,v.source&&(f.source=i.indexOf(v.source),f.originalLine=v.originalLine,f.originalColumn=v.originalColumn,v.name&&(f.name=o.indexOf(v.name)),s.push(f)),l.push(f)}return W(t.__originalMappings,h.compareByOriginalPositions),t};S.prototype._version=3;Object.defineProperty(S.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Ze(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}S.prototype._parseMappings=function(e,n){for(var t=1,o=0,i=0,u=0,l=0,s=0,a=e.length,c=0,v={},f={},g=[],M=[],y,q,_,R,K;c<a;)if(e.charAt(c)===";")t++,c++,o=0;else if(e.charAt(c)===",")c++;else{for(y=new Ze,y.generatedLine=t,R=c;R<a&&!this._charIsMappingSeparator(e,R);R++);if(q=e.slice(c,R),_=v[q],_)c+=q.length;else{for(_=[];c<R;)Fr.decode(e,c,f),K=f.value,c=f.rest,_.push(K);if(_.length===2)throw new Error("Found a source, but no line and column");if(_.length===3)throw new Error("Found a source and line, but no column");v[q]=_}y.generatedColumn=o+_[0],o=y.generatedColumn,_.length>1&&(y.source=l+_[1],l+=_[1],y.originalLine=i+_[2],i=y.originalLine,y.originalLine+=1,y.originalColumn=u+_[3],u=y.originalColumn,_.length>4&&(y.name=s+_[4],s+=_[4])),M.push(y),typeof y.originalLine=="number"&&g.push(y)}W(M,h.compareByGeneratedPositionsDeflated),this.__generatedMappings=M,W(g,h.compareByOriginalPositions),this.__originalMappings=g};S.prototype._findMapping=function(e,n,t,o,i,u){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return pe.search(e,n,i,u)};S.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var t=this._generatedMappings[e+1];if(n.generatedLine===t.generatedLine){n.lastGeneratedColumn=t.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}};S.prototype.originalPositionFor=function(e){var n={generatedLine:h.getArg(e,"line"),generatedColumn:h.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",h.compareByGeneratedPositionsDeflated,h.getArg(e,"bias",p.GREATEST_LOWER_BOUND));if(t>=0){var o=this._generatedMappings[t];if(o.generatedLine===n.generatedLine){var i=h.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=h.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var u=h.getArg(o,"name",null);return u!==null&&(u=this._names.at(u)),{source:i,line:h.getArg(o,"originalLine",null),column:h.getArg(o,"originalColumn",null),name:u}}}return{source:null,line:null,column:null,name:null}};S.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};S.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];var o=e;this.sourceRoot!=null&&(o=h.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=h.urlParse(this.sourceRoot))){var u=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(u))return this.sourcesContent[this._sources.indexOf(u)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(n)return null;throw new Error('"'+o+'" is not in the SourceMap.')};S.prototype.generatedPositionFor=function(e){var n=h.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var t={source:n,originalLine:h.getArg(e,"line"),originalColumn:h.getArg(e,"column")},o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",h.compareByOriginalPositions,h.getArg(e,"bias",p.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===t.source)return{line:h.getArg(i,"generatedLine",null),column:h.getArg(i,"generatedColumn",null),lastColumn:h.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};ee.BasicSourceMapConsumer=S;function O(r,e){var n=r;typeof r=="string"&&(n=h.parseSourceMapInput(r));var t=h.getArg(n,"version"),o=h.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new $,this._names=new $;var i={line:-1,column:0};this._sections=o.map(function(u){if(u.url)throw new Error("Support for url field in sections not implemented.");var l=h.getArg(u,"offset"),s=h.getArg(l,"line"),a=h.getArg(l,"column");if(s<i.line||s===i.line&&a<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=l,{generatedOffset:{generatedLine:s+1,generatedColumn:a+1},consumer:new p(h.getArg(u,"map"),e)}})}O.prototype=Object.create(p.prototype);O.prototype.constructor=p;O.prototype._version=3;Object.defineProperty(O.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var n=0;n<this._sections[e].consumer.sources.length;n++)r.push(this._sections[e].consumer.sources[n]);return r}});O.prototype.originalPositionFor=function(e){var n={generatedLine:h.getArg(e,"line"),generatedColumn:h.getArg(e,"column")},t=pe.search(n,this._sections,function(i,u){var l=i.generatedLine-u.generatedOffset.generatedLine;return l||i.generatedColumn-u.generatedOffset.generatedColumn}),o=this._sections[t];return o?o.consumer.originalPositionFor({line:n.generatedLine-(o.generatedOffset.generatedLine-1),column:n.generatedColumn-(o.generatedOffset.generatedLine===n.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};O.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};O.prototype.sourceContentFor=function(e,n){for(var t=0;t<this._sections.length;t++){var o=this._sections[t],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')};O.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var t=this._sections[n];if(t.consumer._findSourceIndex(h.getArg(e,"source"))!==-1){var o=t.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(t.generatedOffset.generatedLine-1),column:o.column+(t.generatedOffset.generatedLine===o.line?t.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};O.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var o=this._sections[t],i=o.consumer._generatedMappings,u=0;u<i.length;u++){var l=i[u],s=o.consumer._sources.at(l.source);s=h.computeSourceURL(o.consumer.sourceRoot,s,this._sourceMapURL),this._sources.add(s),s=this._sources.indexOf(s);var a=null;l.name&&(a=o.consumer._names.at(l.name),this._names.add(a),a=this._names.indexOf(a));var c={source:s,generatedLine:l.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(o.generatedOffset.generatedLine===l.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:a};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}W(this.__generatedMappings,h.compareByGeneratedPositionsDeflated),W(this.__originalMappings,h.compareByOriginalPositions)};ee.IndexedSourceMapConsumer=O});var He=w(Ye=>{d();var Dr=he().SourceMapGenerator,re=U(),Ur=/(\r?\n)/,$r=10,z="$$$isSourceNode$$$";function L(r,e,n,t,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=n??null,this.name=o??null,this[z]=!0,t!=null&&this.add(t)}L.fromStringWithSourceMap=function(e,n,t){var o=new L,i=e.split(Ur),u=0,l=function(){var f=M(),g=M()||"";return f+g;function M(){return u<i.length?i[u++]:void 0}},s=1,a=0,c=null;return n.eachMapping(function(f){if(c!==null)if(s<f.generatedLine)v(c,l()),s++,a=0;else{var g=i[u]||"",M=g.substr(0,f.generatedColumn-a);i[u]=g.substr(f.generatedColumn-a),a=f.generatedColumn,v(c,M),c=f;return}for(;s<f.generatedLine;)o.add(l()),s++;if(a<f.generatedColumn){var g=i[u]||"";o.add(g.substr(0,f.generatedColumn)),i[u]=g.substr(f.generatedColumn),a=f.generatedColumn}c=f},this),u<i.length&&(c&&v(c,l()),o.add(i.splice(u).join(""))),n.sources.forEach(function(f){var g=n.sourceContentFor(f);g!=null&&(t!=null&&(f=re.join(t,f)),o.setSourceContent(f,g))}),o;function v(f,g){if(f===null||f.source===void 0)o.add(g);else{var M=t?re.join(t,f.source):f.source;o.add(new L(f.originalLine,f.originalColumn,M,g,f.name))}}};L.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(n){this.add(n)},this);else if(e[z]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};L.prototype.prepend=function(e){if(Array.isArray(e))for(var n=e.length-1;n>=0;n--)this.prepend(e[n]);else if(e[z]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};L.prototype.walk=function(e){for(var n,t=0,o=this.children.length;t<o;t++)n=this.children[t],n[z]?n.walk(e):n!==""&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})};L.prototype.join=function(e){var n,t,o=this.children.length;if(o>0){for(n=[],t=0;t<o-1;t++)n.push(this.children[t]),n.push(e);n.push(this.children[t]),this.children=n}return this};L.prototype.replaceRight=function(e,n){var t=this.children[this.children.length-1];return t[z]?t.replaceRight(e,n):typeof t=="string"?this.children[this.children.length-1]=t.replace(e,n):this.children.push("".replace(e,n)),this};L.prototype.setSourceContent=function(e,n){this.sourceContents[re.toSetString(e)]=n};L.prototype.walkSourceContents=function(e){for(var n=0,t=this.children.length;n<t;n++)this.children[n][z]&&this.children[n].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),n=0,t=o.length;n<t;n++)e(re.fromSetString(o[n]),this.sourceContents[o[n]])};L.prototype.toString=function(){var e="";return this.walk(function(n){e+=n}),e};L.prototype.toStringWithSourceMap=function(e){var n={code:"",line:1,column:0},t=new Dr(e),o=!1,i=null,u=null,l=null,s=null;return this.walk(function(a,c){n.code+=a,c.source!==null&&c.line!==null&&c.column!==null?((i!==c.source||u!==c.line||l!==c.column||s!==c.name)&&t.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:n.line,column:n.column},name:c.name}),i=c.source,u=c.line,l=c.column,s=c.name,o=!0):o&&(t.addMapping({generated:{line:n.line,column:n.column}}),i=null,o=!1);for(var v=0,f=a.length;v<f;v++)a.charCodeAt(v)===$r?(n.line++,n.column=0,v+1===f?(i=null,o=!1):o&&t.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:n.line,column:n.column},name:c.name})):n.column++}),this.walkSourceContents(function(a,c){t.setSourceContent(a,c)}),{code:n.code,map:t}};Ye.SourceNode=L});var er=w(ne=>{d();ne.SourceMapGenerator=he().SourceMapGenerator;ne.SourceMapConsumer=Ke().SourceMapConsumer;ne.SourceNode=He().SourceNode});var nr=w((Dn,rr)=>{d();var zr=Object.prototype.toString,me=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function kr(r){return zr.call(r).slice(8,-1)==="ArrayBuffer"}function Qr(r,e,n){e>>>=0;var t=r.byteLength-e;if(t<0)throw new RangeError("'offset' is out of bounds");if(n===void 0)n=t;else if(n>>>=0,n>t)throw new RangeError("'length' is out of bounds");return me?Buffer.from(r.slice(e,e+n)):new Buffer(new Uint8Array(r.slice(e,e+n)))}function Vr(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return me?Buffer.from(r,e):new Buffer(r,e)}function Wr(r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return kr(r)?Qr(r,e,n):typeof r=="string"?Vr(r,e):me?Buffer.from(r):new Buffer(r)}rr.exports=Wr});var an=w((B,Ce)=>{d();var Jr=er().SourceMapConsumer,_e=xe("path"),b;try{b=xe("fs"),(!b.existsSync||!b.readFileSync)&&(b=null)}catch{}var Xr=nr();function tr(r,e){return r.require(e)}var or=!1,ir=!1,ye=!1,J="auto",j={},X={},Zr=/^data:application\/json[^,]+base64,/,N=[],G=[];function Me(){return J==="browser"?!0:J==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Kr(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Yr(){return typeof process=="object"&&process!==null?process.version:""}function Hr(){if(typeof process=="object"&&process!==null)return process.stderr}function en(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function te(r){return function(e){for(var n=0;n<r.length;n++){var t=r[n](e);if(t)return t}return null}}var we=te(N);N.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(t,o){return o?"":"/"})),r in j)return j[r];var e="";try{if(b)b.existsSync(r)&&(e=b.readFileSync(r,"utf8"));else{var n=new XMLHttpRequest;n.open("GET",r,!1),n.send(null),n.readyState===4&&n.status===200&&(e=n.responseText)}}catch{}return j[r]=e});function Se(r,e){if(!r)return e;var n=_e.dirname(r),t=/^\w+:\/\/[^\/]*/.exec(n),o=t?t[0]:"",i=n.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+_e.resolve(n.slice(o.length),e).replace(/\\/g,"/")):o+_e.resolve(n.slice(o.length),e)}function rn(r){var e;if(Me())try{var n=new XMLHttpRequest;n.open("GET",r,!1),n.send(null),e=n.readyState===4?n.responseText:null;var t=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(t)return t}catch{}e=we(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,u;u=o.exec(e);)i=u;return i?i[1]:null}var Le=te(G);G.push(function(r){var e=rn(r);if(!e)return null;var n;if(Zr.test(e)){var t=e.slice(e.indexOf(",")+1);n=Xr(t,"base64").toString(),e=r}else e=Se(r,e),n=we(e);return n?{url:e,map:n}:null});function Ee(r){var e=X[r.source];if(!e){var n=Le(r.source);n?(e=X[r.source]={url:n.url,map:new Jr(n.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var u=e.map.sourcesContent[i];if(u){var l=Se(e.url,o);j[l]=u}})):e=X[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var t=e.map.originalPositionFor(r);if(t.source!==null)return t.source=Se(e.url,t.source),t}return r}function sr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var n=Ee({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+sr(e[2])+")":r}function nn(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var n=this.getLineNumber();if(n!=null){e+=":"+n;var t=this.getColumnNumber();t&&(e+=":"+t)}}var o="",i=this.getFunctionName(),u=!0,l=this.isConstructor(),s=!(this.isToplevel()||l);if(s){var a=this.getTypeName();a==="[object Object]"&&(a="null");var c=this.getMethodName();i?(a&&i.indexOf(a)!=0&&(o+=a+"."),o+=i,c&&i.indexOf("."+c)!=i.length-c.length-1&&(o+=" [as "+c+"]")):o+=a+"."+(c||"<anonymous>")}else l?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,u=!1);return u&&(o+=" ("+e+")"),o}function ur(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(n){e[n]=/^(?:is|get)/.test(n)?function(){return r[n].call(r)}:r[n]}),e.toString=nn,e}function lr(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var n=r.getFileName()||r.getScriptNameOrSourceURL();if(n){var t=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,u=i.test(Yr())?0:62;t===1&&o>u&&!Me()&&!r.isEval()&&(o-=u);var l=Ee({source:n,line:t,column:o});e.curPosition=l,r=ur(r);var s=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?s():e.nextPosition.name||s()},r.getFileName=function(){return l.source},r.getLineNumber=function(){return l.line},r.getColumnNumber=function(){return l.column+1},r.getScriptNameOrSourceURL=function(){return l.source},r}var a=r.isEval()&&r.getEvalOrigin();return a&&(a=sr(a),r=ur(r),r.getEvalOrigin=function(){return a}),r}function tn(r,e){ye&&(j={},X={});for(var n=r.name||"Error",t=r.message||"",o=n+": "+t,i={nextPosition:null,curPosition:null},u=[],l=e.length-1;l>=0;l--)u.push(`
2
- at `+lr(e[l],i)),i.nextPosition=i.curPosition;return i.curPosition=i.nextPosition=null,o+u.reverse().join("")}function ar(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var n=e[1],t=+e[2],o=+e[3],i=j[n];if(!i&&b&&b.existsSync(n))try{i=b.readFileSync(n,"utf8")}catch{i=""}if(i){var u=i.split(/(?:\r\n|\r|\n)/)[t-1];if(u)return n+":"+t+`
3
- `+u+`
4
- `+new Array(o).join(" ")+"^"}}return null}function on(r){var e=ar(r),n=Hr();n&&n._handle&&n._handle.setBlocking&&n._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),en(1)}function un(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var n=arguments[1]&&arguments[1].stack,t=this.listeners(e).length>0;if(n&&!t)return on(arguments[1])}return r.apply(this,arguments)}}var sn=N.slice(0),ln=G.slice(0);B.wrapCallSite=lr;B.getErrorSource=ar;B.mapSourcePosition=Ee;B.retrieveSourceMap=Le;B.install=function(r){if(r=r||{},r.environment&&(J=r.environment,["node","browser","auto"].indexOf(J)===-1))throw new Error("environment "+J+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(N.length=0),N.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(G.length=0),G.unshift(r.retrieveSourceMap)),r.hookRequire&&!Me()){var e=tr(Ce,"module"),n=e.prototype._compile;n.__sourceMapSupport||(e.prototype._compile=function(i,u){return j[u]=i,X[u]=void 0,n.call(this,i,u)},e.prototype._compile.__sourceMapSupport=!0)}if(ye||(ye="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),or||(or=!0,Error.prepareStackTrace=tn),!ir){var t="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=tr(Ce,"worker_threads");o.isMainThread===!1&&(t=!1)}catch{}t&&Kr()&&(ir=!0,un())}};B.resetRetrieveHandlers=function(){N.length=0,G.length=0,N=sn.slice(0),G=ln.slice(0),Le=te(G),we=te(N)}});var vr=w((zn,gr)=>{"use strict";d();gr.exports=fr;function fr(r,e,n){r instanceof RegExp&&(r=cr(r,n)),e instanceof RegExp&&(e=cr(e,n));var t=hr(r,e,n);return t&&{start:t[0],end:t[1],pre:n.slice(0,t[0]),body:n.slice(t[0]+r.length,t[1]),post:n.slice(t[1]+e.length)}}function cr(r,e){var n=e.match(r);return n?n[0]:null}fr.range=hr;function hr(r,e,n){var t,o,i,u,l,s=n.indexOf(r),a=n.indexOf(e,s+1),c=s;if(s>=0&&a>0){if(r===e)return[s,a];for(t=[],i=n.length;c>=0&&!l;)c==s?(t.push(c),s=n.indexOf(r,c+1)):t.length==1?l=[t.pop(),a]:(o=t.pop(),o<i&&(i=o,u=a),a=n.indexOf(e,c+1)),c=s<a&&s>=0?s:a;t.length&&(l=[i,u])}return l}});var mn=w((Qn,Cr)=>{d();var dr=vr();Cr.exports=hn;var pr="\0SLASH"+Math.random()+"\0",mr="\0OPEN"+Math.random()+"\0",Ae="\0CLOSE"+Math.random()+"\0",_r="\0COMMA"+Math.random()+"\0",yr="\0PERIOD"+Math.random()+"\0";function Oe(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function cn(r){return r.split("\\\\").join(pr).split("\\{").join(mr).split("\\}").join(Ae).split("\\,").join(_r).split("\\.").join(yr)}function fn(r){return r.split(pr).join("\\").split(mr).join("{").split(Ae).join("}").split(_r).join(",").split(yr).join(".")}function Sr(r){if(!r)return[""];var e=[],n=dr("{","}",r);if(!n)return r.split(",");var t=n.pre,o=n.body,i=n.post,u=t.split(",");u[u.length-1]+="{"+o+"}";var l=Sr(i);return i.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),e.push.apply(e,u),e}function hn(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Z(cn(r),!0).map(fn)):[]}function gn(r){return"{"+r+"}"}function vn(r){return/^-?0\d/.test(r)}function dn(r,e){return r<=e}function pn(r,e){return r>=e}function Z(r,e){var n=[],t=dr("{","}",r);if(!t)return[r];var o=t.pre,i=t.post.length?Z(t.post,!1):[""];if(/\$$/.test(t.pre))for(var u=0;u<i.length;u++){var l=o+"{"+t.body+"}"+i[u];n.push(l)}else{var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(t.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(t.body),c=s||a,v=t.body.indexOf(",")>=0;if(!c&&!v)return t.post.match(/,(?!,).*\}/)?(r=t.pre+"{"+t.body+Ae+t.post,Z(r)):[r];var f;if(c)f=t.body.split(/\.\./);else if(f=Sr(t.body),f.length===1&&(f=Z(f[0],!1).map(gn),f.length===1))return i.map(function(wr){return t.pre+f[0]+wr});var g;if(c){var M=Oe(f[0]),y=Oe(f[1]),q=Math.max(f[0].length,f[1].length),_=f.length==3?Math.abs(Oe(f[2])):1,R=dn,K=y<M;K&&(_*=-1,R=pn);var Mr=f.some(vn);g=[];for(var k=M;R(k,y);k+=_){var A;if(a)A=String.fromCharCode(k),A==="\\"&&(A="");else if(A=String(k),Mr){var be=q-A.length;if(be>0){var Re=new Array(be+1).join("0");k<0?A="-"+Re+A.slice(1):A=Re+A}}g.push(A)}}else{g=[];for(var I=0;I<f.length;I++)g.push.apply(g,Z(f[I],!1))}for(var I=0;I<g.length;I++)for(var u=0;u<i.length;u++){var l=o+g[I]+i[u];(!e||c||l)&&n.push(l)}}return n}});export{er as a,nr as b,an as c,vr as d,mn as e};
@@ -1,15 +0,0 @@
1
- import Command from '@shopify/cli-kit/node/base-command';
2
- export default class StoreAuth extends Command {
3
- static summary: string;
4
- static descriptionWithMarkdown: string;
5
- static description: string | undefined;
6
- static examples: string[];
7
- static flags: {
8
- store: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- scopes: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- 'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- };
14
- run(): Promise<void>;
15
- }
@@ -1,46 +0,0 @@
1
- var _a;
2
- import Command from '@shopify/cli-kit/node/base-command';
3
- import { globalFlags, jsonFlag } from '@shopify/cli-kit/node/cli';
4
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
5
- import { Flags } from '@oclif/core';
6
- import { authenticateStoreWithApp } from '../../services/store/auth/index.js';
7
- import { createStoreAuthPresenter } from '../../services/store/auth/result.js';
8
- class StoreAuth extends Command {
9
- async run() {
10
- const { flags } = await this.parse(_a);
11
- await authenticateStoreWithApp({
12
- store: flags.store,
13
- scopes: flags.scopes,
14
- }, {
15
- presenter: createStoreAuthPresenter(flags.json ? 'json' : 'text'),
16
- });
17
- }
18
- }
19
- _a = StoreAuth;
20
- StoreAuth.summary = 'Authenticate an app against a store for store commands.';
21
- StoreAuth.descriptionWithMarkdown = `Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
22
-
23
- Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;
24
- StoreAuth.description = _a.descriptionWithoutMarkdown();
25
- StoreAuth.examples = [
26
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products',
27
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json',
28
- ];
29
- StoreAuth.flags = {
30
- ...globalFlags,
31
- ...jsonFlag,
32
- store: Flags.string({
33
- char: 's',
34
- description: 'The myshopify.com domain of the store to authenticate against.',
35
- env: 'SHOPIFY_FLAG_STORE',
36
- parse: async (input) => normalizeStoreFqdn(input),
37
- required: true,
38
- }),
39
- scopes: Flags.string({
40
- description: 'Comma-separated Admin API scopes to request for the app.',
41
- env: 'SHOPIFY_FLAG_SCOPES',
42
- required: true,
43
- }),
44
- };
45
- export default StoreAuth;
46
- //# sourceMappingURL=auth.js.map
@@ -1,21 +0,0 @@
1
- import Command from '@shopify/cli-kit/node/base-command';
2
- export default class StoreExecute extends Command {
3
- static summary: string;
4
- static descriptionWithMarkdown: string;
5
- static description: string | undefined;
6
- static examples: string[];
7
- static flags: {
8
- query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- 'query-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- variables: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- 'variable-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- store: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
- 'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- 'allow-mutations': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- 'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
- };
20
- run(): Promise<void>;
21
- }
@@ -1,89 +0,0 @@
1
- var _a;
2
- import Command from '@shopify/cli-kit/node/base-command';
3
- import { globalFlags, jsonFlag } from '@shopify/cli-kit/node/cli';
4
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
5
- import { resolvePath } from '@shopify/cli-kit/node/path';
6
- import { Flags } from '@oclif/core';
7
- import { executeStoreOperation } from '../../services/store/execute/index.js';
8
- import { writeOrOutputStoreExecuteResult } from '../../services/store/execute/result.js';
9
- class StoreExecute extends Command {
10
- async run() {
11
- const { flags } = await this.parse(_a);
12
- const result = await executeStoreOperation({
13
- store: flags.store,
14
- query: flags.query,
15
- queryFile: flags['query-file'],
16
- variables: flags.variables,
17
- variableFile: flags['variable-file'],
18
- version: flags.version,
19
- allowMutations: flags['allow-mutations'],
20
- });
21
- await writeOrOutputStoreExecuteResult(result, flags['output-file'], flags.json ? 'json' : 'text');
22
- }
23
- }
24
- _a = StoreExecute;
25
- StoreExecute.summary = 'Execute GraphQL queries and mutations on a store.';
26
- StoreExecute.descriptionWithMarkdown = `Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.
27
-
28
- Run \`shopify store auth\` first to create stored auth for the store.
29
-
30
- Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.`;
31
- StoreExecute.description = _a.descriptionWithoutMarkdown();
32
- StoreExecute.examples = [
33
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',
34
- `<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,
35
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations',
36
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json',
37
- ];
38
- StoreExecute.flags = {
39
- ...globalFlags,
40
- ...jsonFlag,
41
- query: Flags.string({
42
- char: 'q',
43
- description: 'The GraphQL query or mutation, as a string.',
44
- env: 'SHOPIFY_FLAG_QUERY',
45
- required: false,
46
- exactlyOne: ['query', 'query-file'],
47
- }),
48
- 'query-file': Flags.string({
49
- description: "Path to a file containing the GraphQL query or mutation. Can't be used with --query.",
50
- env: 'SHOPIFY_FLAG_QUERY_FILE',
51
- parse: async (input) => resolvePath(input),
52
- exactlyOne: ['query', 'query-file'],
53
- }),
54
- variables: Flags.string({
55
- char: 'v',
56
- description: 'The values for any GraphQL variables in your query or mutation, in JSON format.',
57
- env: 'SHOPIFY_FLAG_VARIABLES',
58
- exclusive: ['variable-file'],
59
- }),
60
- 'variable-file': Flags.string({
61
- description: "Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",
62
- env: 'SHOPIFY_FLAG_VARIABLE_FILE',
63
- parse: async (input) => resolvePath(input),
64
- exclusive: ['variables'],
65
- }),
66
- store: Flags.string({
67
- char: 's',
68
- description: 'The myshopify.com domain of the store to execute against.',
69
- env: 'SHOPIFY_FLAG_STORE',
70
- parse: async (input) => normalizeStoreFqdn(input),
71
- required: true,
72
- }),
73
- version: Flags.string({
74
- description: 'The API version to use for the query or mutation. Defaults to the latest stable version.',
75
- env: 'SHOPIFY_FLAG_VERSION',
76
- }),
77
- 'output-file': Flags.string({
78
- description: 'The file name where results should be written, instead of STDOUT.',
79
- env: 'SHOPIFY_FLAG_OUTPUT_FILE',
80
- parse: async (input) => resolvePath(input),
81
- }),
82
- 'allow-mutations': Flags.boolean({
83
- description: 'Allow GraphQL mutations to run against the target store.',
84
- env: 'SHOPIFY_FLAG_ALLOW_MUTATIONS',
85
- default: false,
86
- }),
87
- };
88
- export default StoreExecute;
89
- //# sourceMappingURL=execute.js.map
@@ -1,8 +0,0 @@
1
- export interface WaitForAuthCodeOptions {
2
- store: string;
3
- state: string;
4
- port: number;
5
- timeoutMs?: number;
6
- onListening?: () => void | Promise<void>;
7
- }
8
- export declare function waitForStoreAuthCode({ store, state, port, timeoutMs, onListening, }: WaitForAuthCodeOptions): Promise<string>;
@@ -1,140 +0,0 @@
1
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
2
- import { AbortError } from '@shopify/cli-kit/node/error';
3
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
4
- import { timingSafeEqual } from 'crypto';
5
- import { createServer } from 'http';
6
- import { STORE_AUTH_CALLBACK_PATH, maskToken } from './config.js';
7
- import { retryStoreAuthWithPermanentDomainError } from './recovery.js';
8
- function renderAuthCallbackPage(title, message) {
9
- const safeTitle = title
10
- .replace(/&/g, '&amp;')
11
- .replace(/</g, '&lt;')
12
- .replace(/>/g, '&gt;')
13
- .replace(/"/g, '&quot;');
14
- const safeMessage = message
15
- .replace(/&/g, '&amp;')
16
- .replace(/</g, '&lt;')
17
- .replace(/>/g, '&gt;')
18
- .replace(/"/g, '&quot;');
19
- return `<!doctype html>
20
- <html lang="en">
21
- <head>
22
- <meta charset="utf-8" />
23
- <meta name="viewport" content="width=device-width, initial-scale=1" />
24
- <title>${safeTitle}</title>
25
- </head>
26
- <body style="margin:0;background:#f6f6f7;color:#202223;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;">
27
- <main style="max-width:32rem;margin:12vh auto;padding:0 1rem;">
28
- <section style="background:#fff;border:1px solid #e1e3e5;border-radius:12px;padding:1.5rem 1.25rem;box-shadow:0 1px 3px rgba(0,0,0,0.06);">
29
- <h1 style="margin:0 0 0.75rem 0;font-size:1.375rem;line-height:1.2;">${safeTitle}</h1>
30
- <p style="margin:0;font-size:1rem;line-height:1.5;">${safeMessage}</p>
31
- </section>
32
- </main>
33
- </body>
34
- </html>`;
35
- }
36
- export async function waitForStoreAuthCode({ store, state, port, timeoutMs = 5 * 60 * 1000, onListening, }) {
37
- const normalizedStore = normalizeStoreFqdn(store);
38
- return new Promise((resolve, reject) => {
39
- let settled = false;
40
- let isListening = false;
41
- const timeout = setTimeout(() => {
42
- settleWithError(new AbortError('Timed out waiting for OAuth callback.'));
43
- }, timeoutMs);
44
- const server = createServer((req, res) => {
45
- const requestUrl = new URL(req.url ?? '/', `http://127.0.0.1:${port}`);
46
- if (requestUrl.pathname !== STORE_AUTH_CALLBACK_PATH) {
47
- res.statusCode = 404;
48
- res.end('Not found');
49
- return;
50
- }
51
- const { searchParams } = requestUrl;
52
- const fail = (error, tryMessage) => {
53
- const abortError = typeof error === 'string' ? new AbortError(error, tryMessage) : error;
54
- res.statusCode = 400;
55
- res.setHeader('Content-Type', 'text/html');
56
- res.setHeader('Connection', 'close');
57
- res.once('finish', () => settleWithError(abortError));
58
- res.end(renderAuthCallbackPage('Authentication failed', abortError.message));
59
- };
60
- const returnedStore = searchParams.get('shop');
61
- outputDebug(outputContent `Received OAuth callback for shop ${outputToken.raw(returnedStore ?? 'unknown')}`);
62
- if (!returnedStore) {
63
- fail('OAuth callback store does not match the requested store.');
64
- return;
65
- }
66
- const normalizedReturnedStore = normalizeStoreFqdn(returnedStore);
67
- if (normalizedReturnedStore !== normalizedStore) {
68
- fail(retryStoreAuthWithPermanentDomainError(normalizedReturnedStore));
69
- return;
70
- }
71
- const returnedState = searchParams.get('state');
72
- if (!returnedState || !constantTimeEqual(returnedState, state)) {
73
- fail('OAuth callback state does not match the original request.');
74
- return;
75
- }
76
- const error = searchParams.get('error');
77
- if (error) {
78
- fail(`Shopify returned an OAuth error: ${error}`);
79
- return;
80
- }
81
- const code = searchParams.get('code');
82
- if (!code) {
83
- fail('OAuth callback did not include an authorization code.');
84
- return;
85
- }
86
- outputDebug(outputContent `Received authorization code ${outputToken.raw(maskToken(code))}`);
87
- res.statusCode = 200;
88
- res.setHeader('Content-Type', 'text/html');
89
- res.setHeader('Connection', 'close');
90
- res.once('finish', () => settle(() => resolve(code)));
91
- res.end(renderAuthCallbackPage('Authentication succeeded', 'You can close this window and return to the terminal.'));
92
- });
93
- const settle = (callback) => {
94
- if (settled)
95
- return;
96
- settled = true;
97
- clearTimeout(timeout);
98
- const finalize = () => {
99
- callback();
100
- };
101
- if (!isListening) {
102
- finalize();
103
- return;
104
- }
105
- server.close(() => {
106
- isListening = false;
107
- finalize();
108
- });
109
- server.closeIdleConnections?.();
110
- };
111
- const settleWithError = (error) => {
112
- settle(() => reject(error));
113
- };
114
- server.on('error', (error) => {
115
- if (error.code === 'EADDRINUSE') {
116
- settleWithError(new AbortError(`Port ${port} is already in use.`, `Free port ${port} and re-run ${outputToken.genericShellCommand(`shopify store auth --store ${store} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));
117
- return;
118
- }
119
- settleWithError(error);
120
- });
121
- server.listen(port, '127.0.0.1', async () => {
122
- isListening = true;
123
- outputDebug(outputContent `PKCE callback server listening on http://127.0.0.1:${outputToken.raw(String(port))}${outputToken.raw(STORE_AUTH_CALLBACK_PATH)}`);
124
- if (!onListening)
125
- return;
126
- try {
127
- await onListening();
128
- }
129
- catch (error) {
130
- settleWithError(error instanceof Error ? error : new Error(String(error)));
131
- }
132
- });
133
- });
134
- }
135
- function constantTimeEqual(a, b) {
136
- if (a.length !== b.length)
137
- return false;
138
- return timingSafeEqual(Buffer.from(a, 'utf8'), Buffer.from(b, 'utf8'));
139
- }
140
- //# sourceMappingURL=callback.js.map
@@ -1,6 +0,0 @@
1
- export declare const STORE_AUTH_APP_CLIENT_ID = "7e9cb568cfd431c538f36d1ad3f2b4f6";
2
- export declare const DEFAULT_STORE_AUTH_PORT = 13387;
3
- export declare const STORE_AUTH_CALLBACK_PATH = "/auth/callback";
4
- export declare function storeAuthRedirectUri(port: number): string;
5
- export declare function storeAuthSessionKey(store: string): string;
6
- export declare function maskToken(token: string): string;
@@ -1,15 +0,0 @@
1
- export const STORE_AUTH_APP_CLIENT_ID = '7e9cb568cfd431c538f36d1ad3f2b4f6';
2
- export const DEFAULT_STORE_AUTH_PORT = 13387;
3
- export const STORE_AUTH_CALLBACK_PATH = '/auth/callback';
4
- export function storeAuthRedirectUri(port) {
5
- return `http://127.0.0.1:${port}${STORE_AUTH_CALLBACK_PATH}`;
6
- }
7
- export function storeAuthSessionKey(store) {
8
- return `${STORE_AUTH_APP_CLIENT_ID}::${store}`;
9
- }
10
- export function maskToken(token) {
11
- if (token.length <= 10)
12
- return '***';
13
- return `${token.slice(0, 10)}***`;
14
- }
15
- //# sourceMappingURL=config.js.map
@@ -1,5 +0,0 @@
1
- export interface ResolvedStoreAuthScopes {
2
- scopes: string[];
3
- authoritative: boolean;
4
- }
5
- export declare function resolveExistingStoreAuthScopes(store: string): Promise<ResolvedStoreAuthScopes>;
@@ -1,40 +0,0 @@
1
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
2
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
3
- import { getCurrentStoredStoreAppSession } from './session-store.js';
4
- import { loadStoredStoreSession } from './session-lifecycle.js';
5
- import { fetchCurrentStoreAuthScopes } from './token-client.js';
6
- function truncateDebugMessage(message, length = 300) {
7
- return message.slice(0, length);
8
- }
9
- function formatStoreScopeLookupError(error) {
10
- if (error && typeof error === 'object' && 'response' in error) {
11
- const response = error.response;
12
- const status = response?.status;
13
- const details = response?.errors;
14
- if (typeof status === 'number') {
15
- const summary = typeof details === 'string' ? details : JSON.stringify(details);
16
- return truncateDebugMessage(summary ? `HTTP ${status}: ${summary}` : `HTTP ${status}`);
17
- }
18
- }
19
- return truncateDebugMessage(error instanceof Error ? error.message : String(error));
20
- }
21
- export async function resolveExistingStoreAuthScopes(store) {
22
- const normalizedStore = normalizeStoreFqdn(store);
23
- const storedSession = getCurrentStoredStoreAppSession(normalizedStore);
24
- if (!storedSession)
25
- return { scopes: [], authoritative: true };
26
- try {
27
- const usableSession = await loadStoredStoreSession(normalizedStore);
28
- const remoteScopes = await fetchCurrentStoreAuthScopes({
29
- store: usableSession.store,
30
- accessToken: usableSession.accessToken,
31
- });
32
- outputDebug(outputContent `Resolved current remote scopes for ${outputToken.raw(normalizedStore)}: ${outputToken.raw(remoteScopes.join(',') || 'none')}`);
33
- return { scopes: remoteScopes, authoritative: true };
34
- }
35
- catch (error) {
36
- outputDebug(outputContent `Falling back to locally stored scopes for ${outputToken.raw(normalizedStore)} after remote scope lookup failed: ${outputToken.raw(formatStoreScopeLookupError(error))}`);
37
- return { scopes: storedSession.scopes, authoritative: false };
38
- }
39
- }
40
- //# sourceMappingURL=existing-scopes.js.map
@@ -1,18 +0,0 @@
1
- import { openURL } from '@shopify/cli-kit/node/system';
2
- import { exchangeStoreAuthCodeForToken } from './token-client.js';
3
- import { waitForStoreAuthCode } from './callback.js';
4
- import { type ResolvedStoreAuthScopes } from './existing-scopes.js';
5
- import { type StoreAuthPresenter, type StoreAuthResult } from './result.js';
6
- interface StoreAuthInput {
7
- store: string;
8
- scopes: string;
9
- }
10
- interface StoreAuthDependencies {
11
- openURL: typeof openURL;
12
- waitForStoreAuthCode: typeof waitForStoreAuthCode;
13
- exchangeStoreAuthCodeForToken: typeof exchangeStoreAuthCodeForToken;
14
- resolveExistingScopes: (store: string) => Promise<ResolvedStoreAuthScopes>;
15
- presenter: StoreAuthPresenter;
16
- }
17
- export declare function authenticateStoreWithApp(input: StoreAuthInput, dependencies?: Partial<StoreAuthDependencies>): Promise<StoreAuthResult>;
18
- export {};