68 lines
2.0 KiB
JavaScript
68 lines
2.0 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 36466d3530b7d918.083c839b6e.js
|
|
* Module id: 747569
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
let t = (0, e.i(396805).createWithEqualityFn)(
|
|
(e, t) => ({
|
|
markPoints: [],
|
|
loading: !1,
|
|
_nextIndex: 1,
|
|
promptCursorOffset: null,
|
|
addMarkPoint: (r) => {
|
|
let a = t()._nextIndex;
|
|
return (
|
|
e((e) => ({
|
|
markPoints: [
|
|
...e.markPoints,
|
|
{ ...r, index: a, selectedSuggestionIndex: 0 },
|
|
],
|
|
_nextIndex: a + 1,
|
|
})),
|
|
a
|
|
);
|
|
},
|
|
setLoading: (t) => e({ loading: t }),
|
|
updateMarkPointSuggestions: (t, r, a) => {
|
|
e((e) => ({
|
|
markPoints: e.markPoints.map((e) =>
|
|
e.index === t ? { ...e, apiResponseId: r, suggestions: a } : e,
|
|
),
|
|
}));
|
|
},
|
|
setSelectedSuggestion: (t, r) => {
|
|
e((e) => ({
|
|
markPoints: e.markPoints.map((e) =>
|
|
e.apiResponseId === t ? { ...e, selectedSuggestionIndex: r } : e,
|
|
),
|
|
}));
|
|
},
|
|
getMarkPointByApiId: (e) =>
|
|
t().markPoints.find((t) => t.apiResponseId === e),
|
|
setPromptCursorOffset: (t) => e({ promptCursorOffset: t }),
|
|
removeMarkPoint: (t) => {
|
|
e((e) => ({
|
|
markPoints: e.markPoints.filter((e) => e.apiResponseId !== t),
|
|
}));
|
|
},
|
|
removeMarkPointByIndex: (t) => {
|
|
e((e) => ({ markPoints: e.markPoints.filter((e) => e.index !== t) }));
|
|
},
|
|
clearAll: () =>
|
|
e({
|
|
markPoints: [],
|
|
_nextIndex: 1,
|
|
loading: !1,
|
|
promptCursorOffset: null,
|
|
}),
|
|
}),
|
|
Object.is,
|
|
);
|
|
e.s(["useMarkPointStore", 0, t]);
|
|
};
|
|
|
|
export default moduleFactory;
|