etiquetas.js 1.0.0-alpha.6 → 1.0.0-alpha.7
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.
- package/dist/etiquetas.es.js +58 -59
- package/dist/etiquetas.umd.js +28 -28
- package/dist/etiquetas.umd.js.map +1 -1
- package/dist/{index-hPMt3Mo7.js → index-Tvy8FVsM.js} +470 -470
- package/dist/index-Tvy8FVsM.js.map +1 -0
- package/dist/{index.es-CKhxQJQK.js → index.es-yItW81m8.js} +2 -2
- package/dist/{index.es-CKhxQJQK.js.map → index.es-yItW81m8.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-hPMt3Mo7.js.map +0 -1
|
@@ -89,6 +89,232 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
89
89
|
var __forAwait = (obj, it2, method) => (it2 = obj[__knownSymbol("asyncIterator")]) ? it2.call(obj) : (obj = obj[__knownSymbol("iterator")](), it2 = {}, method = (key, fn) => (fn = obj[key]) && (it2[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it2);
|
|
90
90
|
var _Util_static, getExtremumOnCurve_fn, getExtremum_fn, _regex, _toolbar, _colorPicker, _editor, _buttons, _altText, _comment, _signatureDescriptionButton, _l10nRemove, _EditorToolbar_static, pointerDown_fn, _EditorToolbar_instances, focusIn_fn, focusOut_fn, addListenersToElement_fn, divider_get, _buttons2, _toolbar2, _uiManager, _HighlightToolbar_instances, render_fn, getLastPoint_fn, addHighlightButton_fn, _id, _baseId, _id2, _cache, _ImageManager_instances, get_fn, _commands, _locked, _maxSize, _position, _KeyboardManager_instances, serialize_fn, _abortController, _activeEditor, _allEditors, _allLayers, _altTextManager, _annotationStorage, _changedExistingAnnotations, _commandManager, _commentManager, _copyPasteAC, _currentDrawingSession, _currentPageIndex, _deletedAnnotationsElementIds, _draggingEditors, _editorTypes, _editorsToRescale, _enableHighlightFloatingButton, _enableUpdatedAddImage, _enableNewAltTextWhenAddingImage, _filterFactory, _focusMainContainerTimeoutId, _focusManagerAC, _highlightColors, _highlightWhenShiftUp, _highlightToolbar, _idManager, _isEnabled, _isWaiting, _keyboardManagerAC, _lastActiveElement, _mainHighlightColorPicker, _missingCanvases, _mlManager, _mode, _selectedEditors, _selectedTextNode, _signatureManager, _pageColors, _showAllStates, _previousStates, _translation, _translationTimeoutId, _container, _viewer, _viewerAlert, _updateModeCapability, _AnnotationEditorUIManager_instances, getAnchorElementForSelection_fn, getLayerForTextLayer_fn, displayHighlightToolbar_fn, selectionChange_fn, onSelectEnd_fn, addSelectionListener_fn, addFocusManager_fn, removeFocusManager_fn, addKeyboardManager_fn, removeKeyboardManager_fn, addCopyPasteListeners_fn, removeCopyPasteListeners_fn, addDragAndDropListeners_fn, dispatchUpdateStates_fn, dispatchUpdateUI_fn, enableAll_fn, disableAll_fn, addEditorToLayer_fn, lastSelectedEditor_get, isEmpty_fn, selectEditors_fn, _altText2, _altTextDecorative, _altTextButton, _altTextButtonLabel, _altTextTooltip, _altTextTooltipTimeout, _altTextWasFromKeyBoard, _badge, _editor2, _guessedText, _textWithDisclaimer, _useNewAltTextFlow, _l10nNewButton, _AltText_instances, label_get, setState_fn, _commentButton, _commentWasFromKeyBoard, _editor3, _initialText, _text, _date, _deleted, _container2, _isPinching, _isPinchingStopped, _isPinchingDisabled, _onPinchStart, _onPinching, _onPinchEnd, _pointerDownAC, _signal, _touchInfo, _touchManagerAC, _touchMoveAC, _TouchManager_instances, onTouchStart_fn, onTouchMove_fn, onTouchEnd_fn, _accessibilityData, _allResizerDivs, _altText3, _comment2, _disabled, _dragPointerId, _dragPointerType, _keepAspectRatio, _resizersDiv, _lastPointerCoords, _savedDimensions, _focusAC, _focusedResizerName, _hasBeenClicked, _initialRect, _isEditing, _isInEditMode, _isResizerEnabledForKeyboard, _moveInDOMTimeout, _prevDragX, _prevDragY, _telemetryTimeouts, _touchManager, _isDraggable, _zIndex, _AnnotationEditor_instances, translate_fn, _AnnotationEditor_static, rotatePoint_fn, getRotationMatrix_fn, createResizers_fn, resizerPointerdown_fn, resize_fn, addResizeToUndoStack_fn, resizerPointermove_fn, touchPinchStartCallback_fn, touchPinchCallback_fn, touchPinchEndCallback_fn, selectOnPointerEvent_fn, setUpDragSession_fn, addFocusListeners_fn, resizerKeydown_fn, resizerBlur_fn, resizerFocus_fn, setResizerTabIndex_fn, stopResizing_fn, _modified, _modifiedIds, _storage, _AnnotationStorage_instances, setModified_fn, _serializable, _systemFonts, _listeners, _deferred, _messageAC, _MessageHandler_instances, onMessage_fn, createStreamSink_fn, processStreamMessage_fn, deleteStreamController_fn, _enableHWA, _baseUrl, __cache, __defs, _docId, _document, __hcmCache, _id3, _DOMFilterFactory_instances, cache_get, hcmCache_get, defs_get, createTables_fn, createUrl_fn, addLuminosityConversion_fn, addGrayConversion_fn, createFilter_fn, appendFeFunc_fn, addTransferMapConversion_fn, addTransferMapAlphaConversion_fn, getRGB_fn, _CanvasGraphics_instances, restoreInitialState_fn, drawFilter_fn, getScaledPath_fn, _port, _src, _map, _data, _isDisplay, _isPrint, _userSet, _visible, _cachedGetHash, _groups, _initialHash, _order, _OptionalContentConfig_instances, evaluateVisibilityExpression_fn, _objs, _PDFObjects_instances, ensureObj_fn, _g, _capability, _container3, _disableProcessItems, _fontInspectorEnabled, _lang, _layoutTextParams, _pageHeight, _pageWidth, _reader, _rootContainer, _rotation, _scale, _styleCache, _textContentItemsStr, _textContentSource, _textDivs, _textDivProperties, _transform, _ascentCache, _canvasContexts, _canvasCtxFonts, _minFontSize, _pendingTextLayers, _TextLayer_instances, processItems_fn, appendText_fn, layout_fn, _TextLayer_static, getCtx_fn, ensureCtxFont_fn, ensureMinFontSizeComputed_fn, getAscent_fn, _docId2, _capability2, _progressiveDoneListeners, _progressiveReadListeners, _progressListeners, _rangeListeners, _pendingCleanup, _PDFPageProxy_instances, tryCleanup_fn, _capability3, _messageHandler, _port2, _webWorker, _fakeWorkerId, _isWorkerDisabled, _workerPorts, _PDFWorker_instances, resolve_fn, initializeFromPort_fn, initialize_fn, setupFakeWorker_fn, _PDFWorker_static, mainThreadWorkerMessageHandler_get, _methodPromises, _pageCache, _pagePromises, _pageRefCache, _passwordCapability, _WorkerTransport_instances, cacheSimpleMethod_fn, _internalRenderTask, _rAF, _canvasInUse, _button, _buttonSwatch, _defaultColor, _dropdown, _dropdownWasFromKeyboard, _isMainColorPicker, _editor4, _eventBus, _openDropdownAC, _uiManager2, _l10nColor, _ColorPicker_instances, getDropdownRoot_fn, colorSelect_fn, keyDown_fn, openDropdown_fn, pointerDown_fn2, isDropdownVisible_get, _input, _editor5, _uiManager3, _l10nColor2, _updates, _hasBorder, _popupElement, _AnnotationElement_instances, setRectEdited_fn, _LinkAnnotationElement_instances, setInternalLink_fn, bindAttachment_fn, bindSetOCGState_fn, _boundKeyDown, _boundHide, _boundShow, _boundToggle, _color, _container4, _contentsObj, _dateObj, _elements, _parent, _parentRect, _pinned, _popup, _popupAbortController, _position2, _rect, _richText, _titleObj, _updates2, _wasVisible, _PopupElement_instances, addEventListeners_fn, html_get, fontSize_get, fontColor_get, makePopupContent_fn, keyDown_fn2, setPosition_fn, toggle_fn, show_fn, hide_fn, _line, _square, _circle, _polyline, _polylinesGroupElement, _polylines, _InkAnnotationElement_instances, getTransform_fn, _trigger, _FileAttachmentAnnotationElement_instances, download_fn, _accessibilityManager, _annotationCanvasMap, _editableAnnotations, _structTreeLayer, _AnnotationLayer_instances, appendElement_fn, setAnnotationCanvasMap_fn, _color2, _content, _editorDivId, _editModeAC, _fontSize, _FreeTextEditor_instances, updateFontSize_fn, updateColor_fn, extractText_fn, setEditorDimensions_fn, _FreeTextEditor_static, getNodeContent_fn, setContent_fn, serializeContent_fn, deserializeContent_fn, hasElementChanged_fn, _box, _bottom, _innerMargin, _isLTR, _top, _last, _lastX, _lastY, _min, _min_dist, _scaleFactor, _thickness, _points, _MIN_DIST, _MIN_DIFF, _MIN, _FreeDrawOutliner_instances, getLastCoords_fn, toSVGPathTwoPoints_fn, toSVGPathStart_fn, toSVGPathEnd_fn, getOutlineTwoPoints_fn, getOutlineStart_fn, getOutlineEnd_fn, _box2, _bbox, _innerMargin2, _isLTR2, _points2, _scaleFactor2, _outline, _FreeDrawOutline_instances, computeMinMax_fn, _box3, _lastPoint, _verticalEdges, _intervals, _HighlightOutliner_instances, getOutlines_fn, binarySearch_fn, insert_fn, remove_fn, breakEdge_fn, _box4, _outlines, _anchorNode, _anchorOffset, _boxes, _clipPathId, _colorPicker2, _focusOutlines, _focusNode, _focusOffset, _highlightDiv, _highlightOutlines, _id4, _isFreeHighlight, _lastPoint2, _opacity, _outlineId, _text2, _thickness2, _methodOfCreation, _HighlightEditor_instances, createOutlines_fn, createFreeOutlines_fn, updateColor_fn2, updateThickness_fn, changeThickness_fn, cleanDrawLayer_fn, addToDrawLayer_fn, _HighlightEditor_static, rotateBbox_fn, keydown_fn, setCaret_fn, getRotation_fn, serializeBoxes_fn, serializeOutlines_fn, highlightMove_fn, endHighlight_fn, hasElementChanged_fn2, _svgProperties, _drawOutlines, _mustBeCommitted, _currentDraw, _currentDrawingAC, _currentDrawingOptions, _currentPointerId, _currentPointerType, _currentPointerIds, _currentMoveTimestamp, _DrawingEditor_instances, createDrawOutlines_fn, createDrawing_fn, cleanDrawLayer_fn2, addToDrawLayer_fn2, convertToParentSpace_fn, convertToDrawSpace_fn, updateBbox_fn, rotateBox_fn, _last2, _line2, _lines, _rotation2, _thickness3, _points3, _lastSVGPath, _lastIndex, _outlines2, _parentWidth, _parentHeight, _InkDrawOutliner_instances, normalizePoint_fn, _bbox2, _currentRotation, _innerMargin3, _lines2, _parentWidth2, _parentHeight2, _parentScale, _rotation3, _thickness4, _InkDrawOutline_instances, getMarginComponents_fn, getBBoxWithNoMargin_fn, computeBbox_fn, updateThickness_fn2, _InkEditor_instances, hasElementChanged_fn3, _PARAMETERS, _SignatureExtractor_static, neighborIndexToId_fn, _neighborIdToIndex, clockwiseNonZero_fn, counterClockwiseNonZero_fn, findContours_fn, douglasPeuckerHelper_fn, douglasPeucker_fn, bilateralFilter_fn, getHistogram_fn, toUint8_fn, guessThreshold_fn, getGrayPixels_fn, _isExtracted, _description, _signatureData, _signatureUUID, _bitmap, _bitmapId, _bitmapPromise, _bitmapUrl, _bitmapFile, _bitmapFileName, _canvas3, _missingCanvas, _resizeTimeoutId, _isSvg, _hasBeenAddedInUndoStack, _StampEditor_instances, getBitmapFetched_fn, getBitmapDone_fn, getBitmap_fn, createCanvas_fn, scaleBitmap_fn, drawBitmap_fn, serializeBitmap_fn, hasElementChanged_fn4, _accessibilityManager2, _allowClick, _annotationLayer, _clickAC, _editorFocusTimeoutId, _editors, _hadPointerDown, _isDisabling, _isEnabling, _drawingAC, _focusedElement, _textLayer, _textSelectionAC, _textLayerDblClickAC, _lastPointerDownTimestamp, _uiManager4, _editorTypes2, _AnnotationEditorLayer_instances, textLayerPointerDown_fn, currentEditorType_get, createNewEditor_fn, getCenterPoint_fn, cleanup_fn, _parent2, _mapping, _toUpdate, _id5, _DrawLayer_static, setBox_fn, _DrawLayer_instances, createSVG_fn, createClipPath_fn, updateProperties_fn;
|
|
91
91
|
import axios from "axios";
|
|
92
|
+
const API_BASE_URL = "https://db33.dev.dinabox.net/api";
|
|
93
|
+
const apiClient = axios.create({
|
|
94
|
+
baseURL: API_BASE_URL,
|
|
95
|
+
timeout: 1e4,
|
|
96
|
+
headers: {
|
|
97
|
+
"Content-Type": "application/json",
|
|
98
|
+
"Accept": "application/json"
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const updateApiToken = (token) => {
|
|
102
|
+
if (token) {
|
|
103
|
+
apiClient.defaults.headers.common["Authorization"] = `${token}`;
|
|
104
|
+
console.log("🔑 Token de API atualizado");
|
|
105
|
+
} else {
|
|
106
|
+
console.warn("⚠️ Token não fornecido");
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const LABEL_TYPES$1 = {
|
|
110
|
+
PART: "part",
|
|
111
|
+
SCRAP: "scrap",
|
|
112
|
+
THICKENED: "thickened",
|
|
113
|
+
INPUT: "input",
|
|
114
|
+
VOLUME: "volume"
|
|
115
|
+
};
|
|
116
|
+
apiClient.interceptors.response.use(
|
|
117
|
+
(response) => response,
|
|
118
|
+
(error) => {
|
|
119
|
+
var _a2;
|
|
120
|
+
console.error("Erro na API:", ((_a2 = error.response) == null ? void 0 : _a2.data) || error.message);
|
|
121
|
+
return Promise.reject(error);
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
class LabelsAPI {
|
|
125
|
+
/**
|
|
126
|
+
* Lista etiquetas com filtros opcionais
|
|
127
|
+
* GET /v1/labels
|
|
128
|
+
*
|
|
129
|
+
* @param {Object} params - Parâmetros de consulta
|
|
130
|
+
* @param {number} [params.p] - Página
|
|
131
|
+
* @param {string} [params.s] - Busca
|
|
132
|
+
* @param {number} [params.label_id] - ID da etiqueta
|
|
133
|
+
* @param {string} [params.label_type] - Tipo da etiqueta (part, scrap, thickened, input, volume)
|
|
134
|
+
* @returns {Promise} Resposta da API
|
|
135
|
+
*/
|
|
136
|
+
static getLabels() {
|
|
137
|
+
return __async(this, arguments, function* (params = {}) {
|
|
138
|
+
try {
|
|
139
|
+
const response = yield apiClient.get("/v1/labels", { params });
|
|
140
|
+
return response.data;
|
|
141
|
+
} catch (error) {
|
|
142
|
+
throw new Error(`Erro ao buscar etiquetas: ${error.message}`);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Busca etiquetas por página
|
|
148
|
+
*
|
|
149
|
+
* @param {number} page - Número da página
|
|
150
|
+
* @param {Object} filters - Filtros adicionais
|
|
151
|
+
* @returns {Promise} Resposta da API
|
|
152
|
+
*/
|
|
153
|
+
static getLabelsByPage() {
|
|
154
|
+
return __async(this, arguments, function* (page = 1, filters = {}) {
|
|
155
|
+
return this.getLabels(__spreadValues({ p: page }, filters));
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Busca etiquetas por termo de pesquisa
|
|
160
|
+
*
|
|
161
|
+
* @param {string} searchTerm - Termo de busca
|
|
162
|
+
* @param {Object} filters - Filtros adicionais
|
|
163
|
+
* @returns {Promise} Resposta da API
|
|
164
|
+
*/
|
|
165
|
+
static searchLabels(_0) {
|
|
166
|
+
return __async(this, arguments, function* (searchTerm, filters = {}) {
|
|
167
|
+
return this.getLabels(__spreadValues({ s: searchTerm }, filters));
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Busca etiquetas por tipo
|
|
172
|
+
*
|
|
173
|
+
* @param {string} labelType - Tipo da etiqueta
|
|
174
|
+
* @param {Object} filters - Filtros adicionais
|
|
175
|
+
* @returns {Promise} Resposta da API
|
|
176
|
+
*/
|
|
177
|
+
static getLabelsByType(_0) {
|
|
178
|
+
return __async(this, arguments, function* (labelType, filters = {}) {
|
|
179
|
+
this.validateLabelType(labelType, true);
|
|
180
|
+
return this.getLabels(__spreadValues({ label_type: labelType }, filters));
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Obtém uma etiqueta específica
|
|
185
|
+
* GET /v1/label
|
|
186
|
+
*
|
|
187
|
+
* @param {number} labelId - ID da etiqueta
|
|
188
|
+
* @returns {Promise} Resposta da API
|
|
189
|
+
*/
|
|
190
|
+
static getLabel(labelId) {
|
|
191
|
+
return __async(this, null, function* () {
|
|
192
|
+
try {
|
|
193
|
+
const response = yield apiClient.get("/v1/label", {
|
|
194
|
+
params: { label_id: labelId }
|
|
195
|
+
});
|
|
196
|
+
if (!response.data || !response.data.labels || !response.data.labels.length) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
return response.data.labels.filter((label) => label.label_id == labelId)[0] || null;
|
|
200
|
+
} catch (error) {
|
|
201
|
+
throw new Error(`Erro ao buscar etiqueta ${labelId}: ${error.message}`);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Cria uma nova etiqueta
|
|
207
|
+
* POST /v1/label
|
|
208
|
+
*
|
|
209
|
+
* @param {Object} labelData - Dados da etiqueta
|
|
210
|
+
* @param {string} [labelData.label_type] - Tipo da etiqueta
|
|
211
|
+
* @param {string} [labelData.label_name] - Nome da etiqueta
|
|
212
|
+
* @param {string} [labelData.label_content] - Conteúdo da etiqueta
|
|
213
|
+
* @returns {Promise} Resposta da API
|
|
214
|
+
*/
|
|
215
|
+
static createLabel(labelData) {
|
|
216
|
+
return __async(this, null, function* () {
|
|
217
|
+
try {
|
|
218
|
+
if (labelData.label_type) {
|
|
219
|
+
this.validateLabelType(labelData.label_type, true);
|
|
220
|
+
}
|
|
221
|
+
const response = yield apiClient.post("/v1/label", labelData);
|
|
222
|
+
return response.data;
|
|
223
|
+
} catch (error) {
|
|
224
|
+
throw new Error(`Erro ao criar etiqueta: ${error.message}`);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Valida se o tipo de etiqueta é um dos tipos permitidos
|
|
230
|
+
*
|
|
231
|
+
* @param {string} labelType - Tipo de etiqueta a ser validado
|
|
232
|
+
* @returns {boolean} True se for válido, false caso contrário
|
|
233
|
+
* @throws {Error} Se o tipo for inválido e throwError for true
|
|
234
|
+
*/
|
|
235
|
+
static validateLabelType(labelType, throwError = false) {
|
|
236
|
+
const isValid = Object.values(LABEL_TYPES$1).includes(labelType);
|
|
237
|
+
if (!isValid && throwError) {
|
|
238
|
+
throw new Error(`Tipo de etiqueta inválido: "${labelType}" não é um de part, scrap, thickened, input e volume.`);
|
|
239
|
+
}
|
|
240
|
+
return isValid;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Retorna um tipo de etiqueta se for válido
|
|
244
|
+
*
|
|
245
|
+
* @param {string} labelType - Tipo de etiqueta a verificar
|
|
246
|
+
* @returns {string} O tipo de etiqueta validado
|
|
247
|
+
* @throws {Error} Se o tipo for inválido
|
|
248
|
+
*/
|
|
249
|
+
static labelByType(labelType) {
|
|
250
|
+
this.validateLabelType(labelType, true);
|
|
251
|
+
return labelType;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Atualiza uma etiqueta existente
|
|
255
|
+
* POST /v1/label (com label_id)
|
|
256
|
+
*
|
|
257
|
+
* @param {number} labelId - ID da etiqueta
|
|
258
|
+
* @param {Object} labelData - Dados atualizados da etiqueta
|
|
259
|
+
* @returns {Promise} Resposta da API
|
|
260
|
+
*/
|
|
261
|
+
static updateLabel(labelId, labelData) {
|
|
262
|
+
return __async(this, null, function* () {
|
|
263
|
+
try {
|
|
264
|
+
if (labelData.label_type) {
|
|
265
|
+
this.validateLabelType(labelData.label_type, true);
|
|
266
|
+
}
|
|
267
|
+
const response = yield apiClient.post("/v1/label", __spreadValues({
|
|
268
|
+
label_id: labelId
|
|
269
|
+
}, labelData));
|
|
270
|
+
return response.data;
|
|
271
|
+
} catch (error) {
|
|
272
|
+
throw new Error(`Erro ao atualizar etiqueta ${labelId}: ${error.message}`);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Remove uma etiqueta
|
|
278
|
+
* DELETE /v1/label
|
|
279
|
+
*
|
|
280
|
+
* @param {number} labelId - ID da etiqueta
|
|
281
|
+
* @returns {Promise} Resposta da API
|
|
282
|
+
*/
|
|
283
|
+
static deleteLabel(labelId) {
|
|
284
|
+
return __async(this, null, function* () {
|
|
285
|
+
try {
|
|
286
|
+
const response = yield apiClient.delete("/v1/label", {
|
|
287
|
+
params: { label_id: labelId }
|
|
288
|
+
});
|
|
289
|
+
return response.data;
|
|
290
|
+
} catch (error) {
|
|
291
|
+
throw new Error(`Erro ao deletar etiqueta ${labelId}: ${error.message}`);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Configura o token de autenticação
|
|
297
|
+
*
|
|
298
|
+
* @param {string} token - Token de autenticação
|
|
299
|
+
*/
|
|
300
|
+
static setAuthToken(token) {
|
|
301
|
+
apiClient.defaults.headers.common["Authorization"] = `${token}`;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Remove o token de autenticação
|
|
305
|
+
*/
|
|
306
|
+
static removeAuthToken() {
|
|
307
|
+
delete apiClient.defaults.headers.common["Authorization"];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Configura a URL base da API
|
|
311
|
+
*
|
|
312
|
+
* @param {string} baseURL - Nova URL base
|
|
313
|
+
*/
|
|
314
|
+
static setBaseURL(baseURL) {
|
|
315
|
+
apiClient.defaults.baseURL = baseURL;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
92
318
|
const isBrowser = typeof window !== "undefined";
|
|
93
319
|
const isNodeJS$1 = !isBrowser;
|
|
94
320
|
const createBrowserCanvas = (width, height) => {
|
|
@@ -11303,7 +11529,7 @@ function(t2) {
|
|
|
11303
11529
|
*/
|
|
11304
11530
|
function(t2) {
|
|
11305
11531
|
function e2() {
|
|
11306
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
11532
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-yItW81m8.js")).catch(function(t3) {
|
|
11307
11533
|
return Promise.reject(new Error("Could not load canvg: " + t3));
|
|
11308
11534
|
}).then(function(t3) {
|
|
11309
11535
|
return t3.default ? t3.default : t3;
|
|
@@ -18539,10 +18765,10 @@ var Tokenizer = (
|
|
|
18539
18765
|
};
|
|
18540
18766
|
Tokenizer2.prototype.read = function() {
|
|
18541
18767
|
var tokens = [];
|
|
18542
|
-
var
|
|
18543
|
-
while (
|
|
18544
|
-
tokens.push(
|
|
18545
|
-
|
|
18768
|
+
var token = this.consumeToken();
|
|
18769
|
+
while (token !== EOF_TOKEN) {
|
|
18770
|
+
tokens.push(token);
|
|
18771
|
+
token = this.consumeToken();
|
|
18546
18772
|
}
|
|
18547
18773
|
return tokens;
|
|
18548
18774
|
};
|
|
@@ -18977,19 +19203,19 @@ var Parser = (
|
|
|
18977
19203
|
return Parser2.create(value).parseComponentValues();
|
|
18978
19204
|
};
|
|
18979
19205
|
Parser2.prototype.parseComponentValue = function() {
|
|
18980
|
-
var
|
|
18981
|
-
while (
|
|
18982
|
-
|
|
19206
|
+
var token = this.consumeToken();
|
|
19207
|
+
while (token.type === 31) {
|
|
19208
|
+
token = this.consumeToken();
|
|
18983
19209
|
}
|
|
18984
|
-
if (
|
|
19210
|
+
if (token.type === 32) {
|
|
18985
19211
|
throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
|
|
18986
19212
|
}
|
|
18987
|
-
this.reconsumeToken(
|
|
19213
|
+
this.reconsumeToken(token);
|
|
18988
19214
|
var value = this.consumeComponentValue();
|
|
18989
19215
|
do {
|
|
18990
|
-
|
|
18991
|
-
} while (
|
|
18992
|
-
if (
|
|
19216
|
+
token = this.consumeToken();
|
|
19217
|
+
} while (token.type === 31);
|
|
19218
|
+
if (token.type === 32) {
|
|
18993
19219
|
return value;
|
|
18994
19220
|
}
|
|
18995
19221
|
throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
|
|
@@ -19006,27 +19232,27 @@ var Parser = (
|
|
|
19006
19232
|
}
|
|
19007
19233
|
};
|
|
19008
19234
|
Parser2.prototype.consumeComponentValue = function() {
|
|
19009
|
-
var
|
|
19010
|
-
switch (
|
|
19235
|
+
var token = this.consumeToken();
|
|
19236
|
+
switch (token.type) {
|
|
19011
19237
|
case 11:
|
|
19012
19238
|
case 28:
|
|
19013
19239
|
case 2:
|
|
19014
|
-
return this.consumeSimpleBlock(
|
|
19240
|
+
return this.consumeSimpleBlock(token.type);
|
|
19015
19241
|
case 19:
|
|
19016
|
-
return this.consumeFunction(
|
|
19242
|
+
return this.consumeFunction(token);
|
|
19017
19243
|
}
|
|
19018
|
-
return
|
|
19244
|
+
return token;
|
|
19019
19245
|
};
|
|
19020
19246
|
Parser2.prototype.consumeSimpleBlock = function(type) {
|
|
19021
19247
|
var block = { type, values: [] };
|
|
19022
|
-
var
|
|
19248
|
+
var token = this.consumeToken();
|
|
19023
19249
|
while (true) {
|
|
19024
|
-
if (
|
|
19250
|
+
if (token.type === 32 || isEndingTokenFor(token, type)) {
|
|
19025
19251
|
return block;
|
|
19026
19252
|
}
|
|
19027
|
-
this.reconsumeToken(
|
|
19253
|
+
this.reconsumeToken(token);
|
|
19028
19254
|
block.values.push(this.consumeComponentValue());
|
|
19029
|
-
|
|
19255
|
+
token = this.consumeToken();
|
|
19030
19256
|
}
|
|
19031
19257
|
};
|
|
19032
19258
|
Parser2.prototype.consumeFunction = function(functionToken) {
|
|
@@ -19037,50 +19263,50 @@ var Parser = (
|
|
|
19037
19263
|
/* FUNCTION */
|
|
19038
19264
|
};
|
|
19039
19265
|
while (true) {
|
|
19040
|
-
var
|
|
19041
|
-
if (
|
|
19266
|
+
var token = this.consumeToken();
|
|
19267
|
+
if (token.type === 32 || token.type === 3) {
|
|
19042
19268
|
return cssFunction;
|
|
19043
19269
|
}
|
|
19044
|
-
this.reconsumeToken(
|
|
19270
|
+
this.reconsumeToken(token);
|
|
19045
19271
|
cssFunction.values.push(this.consumeComponentValue());
|
|
19046
19272
|
}
|
|
19047
19273
|
};
|
|
19048
19274
|
Parser2.prototype.consumeToken = function() {
|
|
19049
|
-
var
|
|
19050
|
-
return typeof
|
|
19275
|
+
var token = this._tokens.shift();
|
|
19276
|
+
return typeof token === "undefined" ? EOF_TOKEN : token;
|
|
19051
19277
|
};
|
|
19052
|
-
Parser2.prototype.reconsumeToken = function(
|
|
19053
|
-
this._tokens.unshift(
|
|
19278
|
+
Parser2.prototype.reconsumeToken = function(token) {
|
|
19279
|
+
this._tokens.unshift(token);
|
|
19054
19280
|
};
|
|
19055
19281
|
return Parser2;
|
|
19056
19282
|
}()
|
|
19057
19283
|
);
|
|
19058
|
-
var isDimensionToken = function(
|
|
19059
|
-
return
|
|
19284
|
+
var isDimensionToken = function(token) {
|
|
19285
|
+
return token.type === 15;
|
|
19060
19286
|
};
|
|
19061
|
-
var isNumberToken = function(
|
|
19062
|
-
return
|
|
19287
|
+
var isNumberToken = function(token) {
|
|
19288
|
+
return token.type === 17;
|
|
19063
19289
|
};
|
|
19064
|
-
var isIdentToken = function(
|
|
19065
|
-
return
|
|
19290
|
+
var isIdentToken = function(token) {
|
|
19291
|
+
return token.type === 20;
|
|
19066
19292
|
};
|
|
19067
|
-
var isStringToken = function(
|
|
19068
|
-
return
|
|
19293
|
+
var isStringToken = function(token) {
|
|
19294
|
+
return token.type === 0;
|
|
19069
19295
|
};
|
|
19070
|
-
var isIdentWithValue = function(
|
|
19071
|
-
return isIdentToken(
|
|
19296
|
+
var isIdentWithValue = function(token, value) {
|
|
19297
|
+
return isIdentToken(token) && token.value === value;
|
|
19072
19298
|
};
|
|
19073
|
-
var nonWhiteSpace = function(
|
|
19074
|
-
return
|
|
19299
|
+
var nonWhiteSpace = function(token) {
|
|
19300
|
+
return token.type !== 31;
|
|
19075
19301
|
};
|
|
19076
|
-
var nonFunctionArgSeparator = function(
|
|
19077
|
-
return
|
|
19302
|
+
var nonFunctionArgSeparator = function(token) {
|
|
19303
|
+
return token.type !== 31 && token.type !== 4;
|
|
19078
19304
|
};
|
|
19079
19305
|
var parseFunctionArgs = function(tokens) {
|
|
19080
19306
|
var args = [];
|
|
19081
19307
|
var arg = [];
|
|
19082
|
-
tokens.forEach(function(
|
|
19083
|
-
if (
|
|
19308
|
+
tokens.forEach(function(token) {
|
|
19309
|
+
if (token.type === 4) {
|
|
19084
19310
|
if (arg.length === 0) {
|
|
19085
19311
|
throw new Error("Error parsing function args, zero tokens for arg");
|
|
19086
19312
|
}
|
|
@@ -19088,8 +19314,8 @@ var parseFunctionArgs = function(tokens) {
|
|
|
19088
19314
|
arg = [];
|
|
19089
19315
|
return;
|
|
19090
19316
|
}
|
|
19091
|
-
if (
|
|
19092
|
-
arg.push(
|
|
19317
|
+
if (token.type !== 31) {
|
|
19318
|
+
arg.push(token);
|
|
19093
19319
|
}
|
|
19094
19320
|
});
|
|
19095
19321
|
if (arg.length) {
|
|
@@ -19097,20 +19323,20 @@ var parseFunctionArgs = function(tokens) {
|
|
|
19097
19323
|
}
|
|
19098
19324
|
return args;
|
|
19099
19325
|
};
|
|
19100
|
-
var isEndingTokenFor = function(
|
|
19101
|
-
if (type === 11 &&
|
|
19326
|
+
var isEndingTokenFor = function(token, type) {
|
|
19327
|
+
if (type === 11 && token.type === 12) {
|
|
19102
19328
|
return true;
|
|
19103
19329
|
}
|
|
19104
|
-
if (type === 28 &&
|
|
19330
|
+
if (type === 28 && token.type === 29) {
|
|
19105
19331
|
return true;
|
|
19106
19332
|
}
|
|
19107
|
-
return type === 2 &&
|
|
19333
|
+
return type === 2 && token.type === 3;
|
|
19108
19334
|
};
|
|
19109
|
-
var isLength = function(
|
|
19110
|
-
return
|
|
19335
|
+
var isLength = function(token) {
|
|
19336
|
+
return token.type === 17 || token.type === 15;
|
|
19111
19337
|
};
|
|
19112
|
-
var isLengthPercentage = function(
|
|
19113
|
-
return
|
|
19338
|
+
var isLengthPercentage = function(token) {
|
|
19339
|
+
return token.type === 16 || isLength(token);
|
|
19114
19340
|
};
|
|
19115
19341
|
var parseLengthPercentageTuple = function(tokens) {
|
|
19116
19342
|
return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
|
|
@@ -19134,21 +19360,21 @@ var getAbsoluteValueForTuple = function(tuple, width, height) {
|
|
|
19134
19360
|
var x2 = tuple[0], y2 = tuple[1];
|
|
19135
19361
|
return [getAbsoluteValue(x2, width), getAbsoluteValue(typeof y2 !== "undefined" ? y2 : x2, height)];
|
|
19136
19362
|
};
|
|
19137
|
-
var getAbsoluteValue = function(
|
|
19138
|
-
if (
|
|
19139
|
-
return
|
|
19363
|
+
var getAbsoluteValue = function(token, parent) {
|
|
19364
|
+
if (token.type === 16) {
|
|
19365
|
+
return token.number / 100 * parent;
|
|
19140
19366
|
}
|
|
19141
|
-
if (isDimensionToken(
|
|
19142
|
-
switch (
|
|
19367
|
+
if (isDimensionToken(token)) {
|
|
19368
|
+
switch (token.unit) {
|
|
19143
19369
|
case "rem":
|
|
19144
19370
|
case "em":
|
|
19145
|
-
return 16 *
|
|
19371
|
+
return 16 * token.number;
|
|
19146
19372
|
case "px":
|
|
19147
19373
|
default:
|
|
19148
|
-
return
|
|
19374
|
+
return token.number;
|
|
19149
19375
|
}
|
|
19150
19376
|
}
|
|
19151
|
-
return
|
|
19377
|
+
return token.number;
|
|
19152
19378
|
};
|
|
19153
19379
|
var DEG = "deg";
|
|
19154
19380
|
var GRAD = "grad";
|
|
@@ -19283,13 +19509,13 @@ var asString = function(color2) {
|
|
|
19283
19509
|
var pack = function(r, g2, b2, a2) {
|
|
19284
19510
|
return (r << 24 | g2 << 16 | b2 << 8 | Math.round(a2 * 255) << 0) >>> 0;
|
|
19285
19511
|
};
|
|
19286
|
-
var getTokenColorValue = function(
|
|
19287
|
-
if (
|
|
19288
|
-
return
|
|
19512
|
+
var getTokenColorValue = function(token, i) {
|
|
19513
|
+
if (token.type === 17) {
|
|
19514
|
+
return token.number;
|
|
19289
19515
|
}
|
|
19290
|
-
if (
|
|
19516
|
+
if (token.type === 16) {
|
|
19291
19517
|
var max2 = i === 3 ? 1 : 255;
|
|
19292
|
-
return i === 3 ?
|
|
19518
|
+
return i === 3 ? token.number / 100 * max2 : Math.round(token.number / 100 * max2);
|
|
19293
19519
|
}
|
|
19294
19520
|
return 0;
|
|
19295
19521
|
};
|
|
@@ -19505,9 +19731,9 @@ var backgroundClip = {
|
|
|
19505
19731
|
prefix: false,
|
|
19506
19732
|
type: 1,
|
|
19507
19733
|
parse: function(_context, tokens) {
|
|
19508
|
-
return tokens.map(function(
|
|
19509
|
-
if (isIdentToken(
|
|
19510
|
-
switch (
|
|
19734
|
+
return tokens.map(function(token) {
|
|
19735
|
+
if (isIdentToken(token)) {
|
|
19736
|
+
switch (token.value) {
|
|
19511
19737
|
case "padding-box":
|
|
19512
19738
|
return 1;
|
|
19513
19739
|
case "content-box":
|
|
@@ -19777,10 +20003,10 @@ var radialGradient = function(context, tokens) {
|
|
|
19777
20003
|
var isColorStop = true;
|
|
19778
20004
|
if (i === 0) {
|
|
19779
20005
|
var isAtPosition_1 = false;
|
|
19780
|
-
isColorStop = arg.reduce(function(acc,
|
|
20006
|
+
isColorStop = arg.reduce(function(acc, token) {
|
|
19781
20007
|
if (isAtPosition_1) {
|
|
19782
|
-
if (isIdentToken(
|
|
19783
|
-
switch (
|
|
20008
|
+
if (isIdentToken(token)) {
|
|
20009
|
+
switch (token.value) {
|
|
19784
20010
|
case "center":
|
|
19785
20011
|
position2.push(FIFTY_PERCENT);
|
|
19786
20012
|
return acc;
|
|
@@ -19793,11 +20019,11 @@ var radialGradient = function(context, tokens) {
|
|
|
19793
20019
|
position2.push(HUNDRED_PERCENT);
|
|
19794
20020
|
return acc;
|
|
19795
20021
|
}
|
|
19796
|
-
} else if (isLengthPercentage(
|
|
19797
|
-
position2.push(
|
|
20022
|
+
} else if (isLengthPercentage(token) || isLength(token)) {
|
|
20023
|
+
position2.push(token);
|
|
19798
20024
|
}
|
|
19799
|
-
} else if (isIdentToken(
|
|
19800
|
-
switch (
|
|
20025
|
+
} else if (isIdentToken(token)) {
|
|
20026
|
+
switch (token.value) {
|
|
19801
20027
|
case CIRCLE:
|
|
19802
20028
|
shape = 0;
|
|
19803
20029
|
return false;
|
|
@@ -19822,11 +20048,11 @@ var radialGradient = function(context, tokens) {
|
|
|
19822
20048
|
size = 3;
|
|
19823
20049
|
return false;
|
|
19824
20050
|
}
|
|
19825
|
-
} else if (isLength(
|
|
20051
|
+
} else if (isLength(token) || isLengthPercentage(token)) {
|
|
19826
20052
|
if (!Array.isArray(size)) {
|
|
19827
20053
|
size = [];
|
|
19828
20054
|
}
|
|
19829
|
-
size.push(
|
|
20055
|
+
size.push(token);
|
|
19830
20056
|
return false;
|
|
19831
20057
|
}
|
|
19832
20058
|
return acc;
|
|
@@ -19854,9 +20080,9 @@ var prefixRadialGradient = function(context, tokens) {
|
|
|
19854
20080
|
parseFunctionArgs(tokens).forEach(function(arg, i) {
|
|
19855
20081
|
var isColorStop = true;
|
|
19856
20082
|
if (i === 0) {
|
|
19857
|
-
isColorStop = arg.reduce(function(acc,
|
|
19858
|
-
if (isIdentToken(
|
|
19859
|
-
switch (
|
|
20083
|
+
isColorStop = arg.reduce(function(acc, token) {
|
|
20084
|
+
if (isIdentToken(token)) {
|
|
20085
|
+
switch (token.value) {
|
|
19860
20086
|
case "center":
|
|
19861
20087
|
position2.push(FIFTY_PERCENT);
|
|
19862
20088
|
return false;
|
|
@@ -19869,16 +20095,16 @@ var prefixRadialGradient = function(context, tokens) {
|
|
|
19869
20095
|
position2.push(HUNDRED_PERCENT);
|
|
19870
20096
|
return false;
|
|
19871
20097
|
}
|
|
19872
|
-
} else if (isLengthPercentage(
|
|
19873
|
-
position2.push(
|
|
20098
|
+
} else if (isLengthPercentage(token) || isLength(token)) {
|
|
20099
|
+
position2.push(token);
|
|
19874
20100
|
return false;
|
|
19875
20101
|
}
|
|
19876
20102
|
return acc;
|
|
19877
20103
|
}, isColorStop);
|
|
19878
20104
|
} else if (i === 1) {
|
|
19879
|
-
isColorStop = arg.reduce(function(acc,
|
|
19880
|
-
if (isIdentToken(
|
|
19881
|
-
switch (
|
|
20105
|
+
isColorStop = arg.reduce(function(acc, token) {
|
|
20106
|
+
if (isIdentToken(token)) {
|
|
20107
|
+
switch (token.value) {
|
|
19882
20108
|
case CIRCLE:
|
|
19883
20109
|
shape = 0;
|
|
19884
20110
|
return false;
|
|
@@ -19900,11 +20126,11 @@ var prefixRadialGradient = function(context, tokens) {
|
|
|
19900
20126
|
size = 3;
|
|
19901
20127
|
return false;
|
|
19902
20128
|
}
|
|
19903
|
-
} else if (isLength(
|
|
20129
|
+
} else if (isLength(token) || isLengthPercentage(token)) {
|
|
19904
20130
|
if (!Array.isArray(size)) {
|
|
19905
20131
|
size = [];
|
|
19906
20132
|
}
|
|
19907
|
-
size.push(
|
|
20133
|
+
size.push(token);
|
|
19908
20134
|
return false;
|
|
19909
20135
|
}
|
|
19910
20136
|
return acc;
|
|
@@ -19994,9 +20220,9 @@ var backgroundOrigin = {
|
|
|
19994
20220
|
prefix: false,
|
|
19995
20221
|
type: 1,
|
|
19996
20222
|
parse: function(_context, tokens) {
|
|
19997
|
-
return tokens.map(function(
|
|
19998
|
-
if (isIdentToken(
|
|
19999
|
-
switch (
|
|
20223
|
+
return tokens.map(function(token) {
|
|
20224
|
+
if (isIdentToken(token)) {
|
|
20225
|
+
switch (token.value) {
|
|
20000
20226
|
case "padding-box":
|
|
20001
20227
|
return 1;
|
|
20002
20228
|
case "content-box":
|
|
@@ -20025,8 +20251,8 @@ var backgroundRepeat = {
|
|
|
20025
20251
|
type: 1,
|
|
20026
20252
|
parse: function(_context, tokens) {
|
|
20027
20253
|
return parseFunctionArgs(tokens).map(function(values2) {
|
|
20028
|
-
return values2.filter(isIdentToken).map(function(
|
|
20029
|
-
return
|
|
20254
|
+
return values2.filter(isIdentToken).map(function(token) {
|
|
20255
|
+
return token.value;
|
|
20030
20256
|
}).join(" ");
|
|
20031
20257
|
}).map(parseBackgroundRepeat);
|
|
20032
20258
|
}
|
|
@@ -20125,9 +20351,9 @@ var borderWidthForSide = function(side) {
|
|
|
20125
20351
|
initialValue: "0",
|
|
20126
20352
|
type: 0,
|
|
20127
20353
|
prefix: false,
|
|
20128
|
-
parse: function(_context,
|
|
20129
|
-
if (isDimensionToken(
|
|
20130
|
-
return
|
|
20354
|
+
parse: function(_context, token) {
|
|
20355
|
+
if (isDimensionToken(token)) {
|
|
20356
|
+
return token.number;
|
|
20131
20357
|
}
|
|
20132
20358
|
return 0;
|
|
20133
20359
|
}
|
|
@@ -20166,8 +20392,8 @@ var display = {
|
|
|
20166
20392
|
type: 1,
|
|
20167
20393
|
parse: function(_context, tokens) {
|
|
20168
20394
|
return tokens.filter(isIdentToken).reduce(
|
|
20169
|
-
function(bit,
|
|
20170
|
-
return bit | parseDisplayValue(
|
|
20395
|
+
function(bit, token) {
|
|
20396
|
+
return bit | parseDisplayValue(token.value);
|
|
20171
20397
|
},
|
|
20172
20398
|
0
|
|
20173
20399
|
/* NONE */
|
|
@@ -20264,15 +20490,15 @@ var letterSpacing = {
|
|
|
20264
20490
|
initialValue: "0",
|
|
20265
20491
|
prefix: false,
|
|
20266
20492
|
type: 0,
|
|
20267
|
-
parse: function(_context,
|
|
20268
|
-
if (
|
|
20493
|
+
parse: function(_context, token) {
|
|
20494
|
+
if (token.type === 20 && token.value === "normal") {
|
|
20269
20495
|
return 0;
|
|
20270
20496
|
}
|
|
20271
|
-
if (
|
|
20272
|
-
return
|
|
20497
|
+
if (token.type === 17) {
|
|
20498
|
+
return token.number;
|
|
20273
20499
|
}
|
|
20274
|
-
if (
|
|
20275
|
-
return
|
|
20500
|
+
if (token.type === 15) {
|
|
20501
|
+
return token.number;
|
|
20276
20502
|
}
|
|
20277
20503
|
return 0;
|
|
20278
20504
|
}
|
|
@@ -20304,13 +20530,13 @@ var lineHeight = {
|
|
|
20304
20530
|
type: 4
|
|
20305
20531
|
/* TOKEN_VALUE */
|
|
20306
20532
|
};
|
|
20307
|
-
var computeLineHeight = function(
|
|
20308
|
-
if (isIdentToken(
|
|
20533
|
+
var computeLineHeight = function(token, fontSize2) {
|
|
20534
|
+
if (isIdentToken(token) && token.value === "normal") {
|
|
20309
20535
|
return 1.2 * fontSize2;
|
|
20310
|
-
} else if (
|
|
20311
|
-
return fontSize2 *
|
|
20312
|
-
} else if (isLengthPercentage(
|
|
20313
|
-
return getAbsoluteValue(
|
|
20536
|
+
} else if (token.type === 17) {
|
|
20537
|
+
return fontSize2 * token.number;
|
|
20538
|
+
} else if (isLengthPercentage(token)) {
|
|
20539
|
+
return getAbsoluteValue(token, fontSize2);
|
|
20314
20540
|
}
|
|
20315
20541
|
return fontSize2;
|
|
20316
20542
|
};
|
|
@@ -20319,11 +20545,11 @@ var listStyleImage = {
|
|
|
20319
20545
|
initialValue: "none",
|
|
20320
20546
|
type: 0,
|
|
20321
20547
|
prefix: false,
|
|
20322
|
-
parse: function(context,
|
|
20323
|
-
if (
|
|
20548
|
+
parse: function(context, token) {
|
|
20549
|
+
if (token.type === 20 && token.value === "none") {
|
|
20324
20550
|
return null;
|
|
20325
20551
|
}
|
|
20326
|
-
return image.parse(context,
|
|
20552
|
+
return image.parse(context, token);
|
|
20327
20553
|
}
|
|
20328
20554
|
};
|
|
20329
20555
|
var listStylePosition = {
|
|
@@ -20579,18 +20805,18 @@ var textShadow = {
|
|
|
20579
20805
|
};
|
|
20580
20806
|
var c2 = 0;
|
|
20581
20807
|
for (var i = 0; i < values2.length; i++) {
|
|
20582
|
-
var
|
|
20583
|
-
if (isLength(
|
|
20808
|
+
var token = values2[i];
|
|
20809
|
+
if (isLength(token)) {
|
|
20584
20810
|
if (c2 === 0) {
|
|
20585
|
-
shadow2.offsetX =
|
|
20811
|
+
shadow2.offsetX = token;
|
|
20586
20812
|
} else if (c2 === 1) {
|
|
20587
|
-
shadow2.offsetY =
|
|
20813
|
+
shadow2.offsetY = token;
|
|
20588
20814
|
} else {
|
|
20589
|
-
shadow2.blur =
|
|
20815
|
+
shadow2.blur = token;
|
|
20590
20816
|
}
|
|
20591
20817
|
c2++;
|
|
20592
20818
|
} else {
|
|
20593
|
-
shadow2.color = color$1.parse(context,
|
|
20819
|
+
shadow2.color = color$1.parse(context, token);
|
|
20594
20820
|
}
|
|
20595
20821
|
}
|
|
20596
20822
|
return shadow2;
|
|
@@ -20619,16 +20845,16 @@ var transform$1 = {
|
|
|
20619
20845
|
initialValue: "none",
|
|
20620
20846
|
prefix: true,
|
|
20621
20847
|
type: 0,
|
|
20622
|
-
parse: function(_context,
|
|
20623
|
-
if (
|
|
20848
|
+
parse: function(_context, token) {
|
|
20849
|
+
if (token.type === 20 && token.value === "none") {
|
|
20624
20850
|
return null;
|
|
20625
20851
|
}
|
|
20626
|
-
if (
|
|
20627
|
-
var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[
|
|
20852
|
+
if (token.type === 18) {
|
|
20853
|
+
var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];
|
|
20628
20854
|
if (typeof transformFunction === "undefined") {
|
|
20629
|
-
throw new Error('Attempting to parse an unsupported transform function "' +
|
|
20855
|
+
throw new Error('Attempting to parse an unsupported transform function "' + token.name + '"');
|
|
20630
20856
|
}
|
|
20631
|
-
return transformFunction(
|
|
20857
|
+
return transformFunction(token.values);
|
|
20632
20858
|
}
|
|
20633
20859
|
return null;
|
|
20634
20860
|
}
|
|
@@ -20730,12 +20956,12 @@ var zIndex = {
|
|
|
20730
20956
|
initialValue: "auto",
|
|
20731
20957
|
prefix: false,
|
|
20732
20958
|
type: 0,
|
|
20733
|
-
parse: function(_context,
|
|
20734
|
-
if (
|
|
20959
|
+
parse: function(_context, token) {
|
|
20960
|
+
if (token.type === 20) {
|
|
20735
20961
|
return { auto: true, order: 0 };
|
|
20736
20962
|
}
|
|
20737
|
-
if (isNumberToken(
|
|
20738
|
-
return { auto: false, order:
|
|
20963
|
+
if (isNumberToken(token)) {
|
|
20964
|
+
return { auto: false, order: token.number };
|
|
20739
20965
|
}
|
|
20740
20966
|
throw new Error("Invalid z-index number parsed");
|
|
20741
20967
|
}
|
|
@@ -20759,9 +20985,9 @@ var opacity = {
|
|
|
20759
20985
|
initialValue: "1",
|
|
20760
20986
|
type: 0,
|
|
20761
20987
|
prefix: false,
|
|
20762
|
-
parse: function(_context,
|
|
20763
|
-
if (isNumberToken(
|
|
20764
|
-
return
|
|
20988
|
+
parse: function(_context, token) {
|
|
20989
|
+
if (isNumberToken(token)) {
|
|
20990
|
+
return token.number;
|
|
20765
20991
|
}
|
|
20766
20992
|
return 1;
|
|
20767
20993
|
}
|
|
@@ -20779,8 +21005,8 @@ var textDecorationLine = {
|
|
|
20779
21005
|
prefix: false,
|
|
20780
21006
|
type: 1,
|
|
20781
21007
|
parse: function(_context, tokens) {
|
|
20782
|
-
return tokens.filter(isIdentToken).map(function(
|
|
20783
|
-
switch (
|
|
21008
|
+
return tokens.filter(isIdentToken).map(function(token) {
|
|
21009
|
+
switch (token.value) {
|
|
20784
21010
|
case "underline":
|
|
20785
21011
|
return 1;
|
|
20786
21012
|
case "overline":
|
|
@@ -20804,14 +21030,14 @@ var fontFamily = {
|
|
|
20804
21030
|
parse: function(_context, tokens) {
|
|
20805
21031
|
var accumulator = [];
|
|
20806
21032
|
var results = [];
|
|
20807
|
-
tokens.forEach(function(
|
|
20808
|
-
switch (
|
|
21033
|
+
tokens.forEach(function(token) {
|
|
21034
|
+
switch (token.type) {
|
|
20809
21035
|
case 20:
|
|
20810
21036
|
case 0:
|
|
20811
|
-
accumulator.push(
|
|
21037
|
+
accumulator.push(token.value);
|
|
20812
21038
|
break;
|
|
20813
21039
|
case 17:
|
|
20814
|
-
accumulator.push(
|
|
21040
|
+
accumulator.push(token.number.toString());
|
|
20815
21041
|
break;
|
|
20816
21042
|
case 4:
|
|
20817
21043
|
results.push(accumulator.join(" "));
|
|
@@ -20839,12 +21065,12 @@ var fontWeight = {
|
|
|
20839
21065
|
initialValue: "normal",
|
|
20840
21066
|
type: 0,
|
|
20841
21067
|
prefix: false,
|
|
20842
|
-
parse: function(_context,
|
|
20843
|
-
if (isNumberToken(
|
|
20844
|
-
return
|
|
21068
|
+
parse: function(_context, token) {
|
|
21069
|
+
if (isNumberToken(token)) {
|
|
21070
|
+
return token.number;
|
|
20845
21071
|
}
|
|
20846
|
-
if (isIdentToken(
|
|
20847
|
-
switch (
|
|
21072
|
+
if (isIdentToken(token)) {
|
|
21073
|
+
switch (token.value) {
|
|
20848
21074
|
case "bold":
|
|
20849
21075
|
return 700;
|
|
20850
21076
|
case "normal":
|
|
@@ -20861,8 +21087,8 @@ var fontVariant = {
|
|
|
20861
21087
|
type: 1,
|
|
20862
21088
|
prefix: false,
|
|
20863
21089
|
parse: function(_context, tokens) {
|
|
20864
|
-
return tokens.filter(isIdentToken).map(function(
|
|
20865
|
-
return
|
|
21090
|
+
return tokens.filter(isIdentToken).map(function(token) {
|
|
21091
|
+
return token.value;
|
|
20866
21092
|
});
|
|
20867
21093
|
}
|
|
20868
21094
|
};
|
|
@@ -20956,8 +21182,8 @@ var duration = {
|
|
|
20956
21182
|
prefix: false,
|
|
20957
21183
|
type: 1,
|
|
20958
21184
|
parse: function(context, tokens) {
|
|
20959
|
-
return tokens.filter(isDimensionToken).map(function(
|
|
20960
|
-
return time.parse(context,
|
|
21185
|
+
return tokens.filter(isDimensionToken).map(function(token) {
|
|
21186
|
+
return time.parse(context, token);
|
|
20961
21187
|
});
|
|
20962
21188
|
}
|
|
20963
21189
|
};
|
|
@@ -21017,22 +21243,22 @@ var boxShadow = {
|
|
|
21017
21243
|
};
|
|
21018
21244
|
var c2 = 0;
|
|
21019
21245
|
for (var i = 0; i < values2.length; i++) {
|
|
21020
|
-
var
|
|
21021
|
-
if (isIdentWithValue(
|
|
21246
|
+
var token = values2[i];
|
|
21247
|
+
if (isIdentWithValue(token, "inset")) {
|
|
21022
21248
|
shadow2.inset = true;
|
|
21023
|
-
} else if (isLength(
|
|
21249
|
+
} else if (isLength(token)) {
|
|
21024
21250
|
if (c2 === 0) {
|
|
21025
|
-
shadow2.offsetX =
|
|
21251
|
+
shadow2.offsetX = token;
|
|
21026
21252
|
} else if (c2 === 1) {
|
|
21027
|
-
shadow2.offsetY =
|
|
21253
|
+
shadow2.offsetY = token;
|
|
21028
21254
|
} else if (c2 === 2) {
|
|
21029
|
-
shadow2.blur =
|
|
21255
|
+
shadow2.blur = token;
|
|
21030
21256
|
} else {
|
|
21031
|
-
shadow2.spread =
|
|
21257
|
+
shadow2.spread = token;
|
|
21032
21258
|
}
|
|
21033
21259
|
c2++;
|
|
21034
21260
|
} else {
|
|
21035
|
-
shadow2.color = color$1.parse(context,
|
|
21261
|
+
shadow2.color = color$1.parse(context, token);
|
|
21036
21262
|
}
|
|
21037
21263
|
}
|
|
21038
21264
|
return shadow2;
|
|
@@ -21052,8 +21278,8 @@ var paintOrder = {
|
|
|
21052
21278
|
/* MARKERS */
|
|
21053
21279
|
];
|
|
21054
21280
|
var layers = [];
|
|
21055
|
-
tokens.filter(isIdentToken).forEach(function(
|
|
21056
|
-
switch (
|
|
21281
|
+
tokens.filter(isIdentToken).forEach(function(token) {
|
|
21282
|
+
switch (token.value) {
|
|
21057
21283
|
case "stroke":
|
|
21058
21284
|
layers.push(
|
|
21059
21285
|
1
|
|
@@ -21094,9 +21320,9 @@ var webkitTextStrokeWidth = {
|
|
|
21094
21320
|
initialValue: "0",
|
|
21095
21321
|
type: 0,
|
|
21096
21322
|
prefix: false,
|
|
21097
|
-
parse: function(_context,
|
|
21098
|
-
if (isDimensionToken(
|
|
21099
|
-
return
|
|
21323
|
+
parse: function(_context, token) {
|
|
21324
|
+
if (isDimensionToken(token)) {
|
|
21325
|
+
return token.number;
|
|
21100
21326
|
}
|
|
21101
21327
|
return 0;
|
|
21102
21328
|
}
|
|
@@ -21249,8 +21475,8 @@ var parse = function(context, descriptor, style) {
|
|
|
21249
21475
|
var parser = new Parser(tokenizer.read());
|
|
21250
21476
|
switch (descriptor.type) {
|
|
21251
21477
|
case 2:
|
|
21252
|
-
var
|
|
21253
|
-
return descriptor.parse(context, isIdentToken(
|
|
21478
|
+
var token = parser.parseComponentValue();
|
|
21479
|
+
return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);
|
|
21254
21480
|
case 0:
|
|
21255
21481
|
return descriptor.parse(context, parser.parseComponentValue());
|
|
21256
21482
|
case 1:
|
|
@@ -23020,29 +23246,29 @@ var DocumentCloner = (
|
|
|
23020
23246
|
var declaration = new CSSParsedPseudoDeclaration(this.context, style);
|
|
23021
23247
|
var anonymousReplacedElement = document2.createElement("html2canvaspseudoelement");
|
|
23022
23248
|
copyCSSStyles(style, anonymousReplacedElement);
|
|
23023
|
-
declaration.content.forEach(function(
|
|
23024
|
-
if (
|
|
23025
|
-
anonymousReplacedElement.appendChild(document2.createTextNode(
|
|
23026
|
-
} else if (
|
|
23249
|
+
declaration.content.forEach(function(token) {
|
|
23250
|
+
if (token.type === 0) {
|
|
23251
|
+
anonymousReplacedElement.appendChild(document2.createTextNode(token.value));
|
|
23252
|
+
} else if (token.type === 22) {
|
|
23027
23253
|
var img = document2.createElement("img");
|
|
23028
|
-
img.src =
|
|
23254
|
+
img.src = token.value;
|
|
23029
23255
|
img.style.opacity = "1";
|
|
23030
23256
|
anonymousReplacedElement.appendChild(img);
|
|
23031
|
-
} else if (
|
|
23032
|
-
if (
|
|
23033
|
-
var attr =
|
|
23257
|
+
} else if (token.type === 18) {
|
|
23258
|
+
if (token.name === "attr") {
|
|
23259
|
+
var attr = token.values.filter(isIdentToken);
|
|
23034
23260
|
if (attr.length) {
|
|
23035
23261
|
anonymousReplacedElement.appendChild(document2.createTextNode(node.getAttribute(attr[0].value) || ""));
|
|
23036
23262
|
}
|
|
23037
|
-
} else if (
|
|
23038
|
-
var _a2 =
|
|
23263
|
+
} else if (token.name === "counter") {
|
|
23264
|
+
var _a2 = token.values.filter(nonFunctionArgSeparator), counter = _a2[0], counterStyle = _a2[1];
|
|
23039
23265
|
if (counter && isIdentToken(counter)) {
|
|
23040
23266
|
var counterState = _this.counters.getCounterValue(counter.value);
|
|
23041
23267
|
var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
|
|
23042
23268
|
anonymousReplacedElement.appendChild(document2.createTextNode(createCounterText(counterState, counterType, false)));
|
|
23043
23269
|
}
|
|
23044
|
-
} else if (
|
|
23045
|
-
var _b2 =
|
|
23270
|
+
} else if (token.name === "counters") {
|
|
23271
|
+
var _b2 = token.values.filter(nonFunctionArgSeparator), counter = _b2[0], delim = _b2[1], counterStyle = _b2[2];
|
|
23046
23272
|
if (counter && isIdentToken(counter)) {
|
|
23047
23273
|
var counterStates = _this.counters.getCounterValues(counter.value);
|
|
23048
23274
|
var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
|
|
@@ -23053,8 +23279,8 @@ var DocumentCloner = (
|
|
|
23053
23279
|
anonymousReplacedElement.appendChild(document2.createTextNode(text));
|
|
23054
23280
|
}
|
|
23055
23281
|
} else ;
|
|
23056
|
-
} else if (
|
|
23057
|
-
switch (
|
|
23282
|
+
} else if (token.type === 20) {
|
|
23283
|
+
switch (token.value) {
|
|
23058
23284
|
case "open-quote":
|
|
23059
23285
|
anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true)));
|
|
23060
23286
|
break;
|
|
@@ -23062,7 +23288,7 @@ var DocumentCloner = (
|
|
|
23062
23288
|
anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false)));
|
|
23063
23289
|
break;
|
|
23064
23290
|
default:
|
|
23065
|
-
anonymousReplacedElement.appendChild(document2.createTextNode(
|
|
23291
|
+
anonymousReplacedElement.appendChild(document2.createTextNode(token.value));
|
|
23066
23292
|
}
|
|
23067
23293
|
}
|
|
23068
23294
|
});
|
|
@@ -23929,8 +24155,8 @@ var calculateBackgroundRendering = function(container, index, intrinsicSize) {
|
|
|
23929
24155
|
var offsetY = Math.round(backgroundPositioningArea.top + position2[1]);
|
|
23930
24156
|
return [path, offsetX, offsetY, sizeWidth, sizeHeight];
|
|
23931
24157
|
};
|
|
23932
|
-
var isAuto = function(
|
|
23933
|
-
return isIdentToken(
|
|
24158
|
+
var isAuto = function(token) {
|
|
24159
|
+
return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;
|
|
23934
24160
|
};
|
|
23935
24161
|
var hasIntrinsicValue = function(value) {
|
|
23936
24162
|
return typeof value === "number";
|
|
@@ -58104,232 +58330,6 @@ const makeLamination = (mainObject) => {
|
|
|
58104
58330
|
}
|
|
58105
58331
|
return pdf.output("datauristring");
|
|
58106
58332
|
};
|
|
58107
|
-
const API_BASE_URL = "https://db33.dev.dinabox.net/api";
|
|
58108
|
-
const apiClient$1 = axios.create({
|
|
58109
|
-
baseURL: API_BASE_URL,
|
|
58110
|
-
timeout: 1e4,
|
|
58111
|
-
headers: {
|
|
58112
|
-
"Content-Type": "application/json",
|
|
58113
|
-
"Accept": "application/json"
|
|
58114
|
-
}
|
|
58115
|
-
});
|
|
58116
|
-
const updateApiToken = (token2) => {
|
|
58117
|
-
if (token2) {
|
|
58118
|
-
apiClient$1.defaults.headers.common["Authorization"] = `${token2}`;
|
|
58119
|
-
console.log("🔑 Token de API atualizado");
|
|
58120
|
-
} else {
|
|
58121
|
-
console.warn("⚠️ Token não fornecido");
|
|
58122
|
-
}
|
|
58123
|
-
};
|
|
58124
|
-
const LABEL_TYPES$1 = {
|
|
58125
|
-
PART: "part",
|
|
58126
|
-
SCRAP: "scrap",
|
|
58127
|
-
THICKENED: "thickened",
|
|
58128
|
-
INPUT: "input",
|
|
58129
|
-
VOLUME: "volume"
|
|
58130
|
-
};
|
|
58131
|
-
apiClient$1.interceptors.response.use(
|
|
58132
|
-
(response) => response,
|
|
58133
|
-
(error) => {
|
|
58134
|
-
var _a2;
|
|
58135
|
-
console.error("Erro na API:", ((_a2 = error.response) == null ? void 0 : _a2.data) || error.message);
|
|
58136
|
-
return Promise.reject(error);
|
|
58137
|
-
}
|
|
58138
|
-
);
|
|
58139
|
-
class LabelsAPI {
|
|
58140
|
-
/**
|
|
58141
|
-
* Lista etiquetas com filtros opcionais
|
|
58142
|
-
* GET /v1/labels
|
|
58143
|
-
*
|
|
58144
|
-
* @param {Object} params - Parâmetros de consulta
|
|
58145
|
-
* @param {number} [params.p] - Página
|
|
58146
|
-
* @param {string} [params.s] - Busca
|
|
58147
|
-
* @param {number} [params.label_id] - ID da etiqueta
|
|
58148
|
-
* @param {string} [params.label_type] - Tipo da etiqueta (part, scrap, thickened, input, volume)
|
|
58149
|
-
* @returns {Promise} Resposta da API
|
|
58150
|
-
*/
|
|
58151
|
-
static getLabels() {
|
|
58152
|
-
return __async(this, arguments, function* (params = {}) {
|
|
58153
|
-
try {
|
|
58154
|
-
const response = yield apiClient$1.get("/v1/labels", { params });
|
|
58155
|
-
return response.data;
|
|
58156
|
-
} catch (error) {
|
|
58157
|
-
throw new Error(`Erro ao buscar etiquetas: ${error.message}`);
|
|
58158
|
-
}
|
|
58159
|
-
});
|
|
58160
|
-
}
|
|
58161
|
-
/**
|
|
58162
|
-
* Busca etiquetas por página
|
|
58163
|
-
*
|
|
58164
|
-
* @param {number} page - Número da página
|
|
58165
|
-
* @param {Object} filters - Filtros adicionais
|
|
58166
|
-
* @returns {Promise} Resposta da API
|
|
58167
|
-
*/
|
|
58168
|
-
static getLabelsByPage() {
|
|
58169
|
-
return __async(this, arguments, function* (page = 1, filters = {}) {
|
|
58170
|
-
return this.getLabels(__spreadValues({ p: page }, filters));
|
|
58171
|
-
});
|
|
58172
|
-
}
|
|
58173
|
-
/**
|
|
58174
|
-
* Busca etiquetas por termo de pesquisa
|
|
58175
|
-
*
|
|
58176
|
-
* @param {string} searchTerm - Termo de busca
|
|
58177
|
-
* @param {Object} filters - Filtros adicionais
|
|
58178
|
-
* @returns {Promise} Resposta da API
|
|
58179
|
-
*/
|
|
58180
|
-
static searchLabels(_0) {
|
|
58181
|
-
return __async(this, arguments, function* (searchTerm, filters = {}) {
|
|
58182
|
-
return this.getLabels(__spreadValues({ s: searchTerm }, filters));
|
|
58183
|
-
});
|
|
58184
|
-
}
|
|
58185
|
-
/**
|
|
58186
|
-
* Busca etiquetas por tipo
|
|
58187
|
-
*
|
|
58188
|
-
* @param {string} labelType - Tipo da etiqueta
|
|
58189
|
-
* @param {Object} filters - Filtros adicionais
|
|
58190
|
-
* @returns {Promise} Resposta da API
|
|
58191
|
-
*/
|
|
58192
|
-
static getLabelsByType(_0) {
|
|
58193
|
-
return __async(this, arguments, function* (labelType, filters = {}) {
|
|
58194
|
-
this.validateLabelType(labelType, true);
|
|
58195
|
-
return this.getLabels(__spreadValues({ label_type: labelType }, filters));
|
|
58196
|
-
});
|
|
58197
|
-
}
|
|
58198
|
-
/**
|
|
58199
|
-
* Obtém uma etiqueta específica
|
|
58200
|
-
* GET /v1/label
|
|
58201
|
-
*
|
|
58202
|
-
* @param {number} labelId - ID da etiqueta
|
|
58203
|
-
* @returns {Promise} Resposta da API
|
|
58204
|
-
*/
|
|
58205
|
-
static getLabel(labelId) {
|
|
58206
|
-
return __async(this, null, function* () {
|
|
58207
|
-
try {
|
|
58208
|
-
const response = yield apiClient$1.get("/v1/label", {
|
|
58209
|
-
params: { label_id: labelId }
|
|
58210
|
-
});
|
|
58211
|
-
if (!response.data || !response.data.labels || !response.data.labels.length) {
|
|
58212
|
-
return null;
|
|
58213
|
-
}
|
|
58214
|
-
return response.data.labels.filter((label) => label.label_id == labelId)[0] || null;
|
|
58215
|
-
} catch (error) {
|
|
58216
|
-
throw new Error(`Erro ao buscar etiqueta ${labelId}: ${error.message}`);
|
|
58217
|
-
}
|
|
58218
|
-
});
|
|
58219
|
-
}
|
|
58220
|
-
/**
|
|
58221
|
-
* Cria uma nova etiqueta
|
|
58222
|
-
* POST /v1/label
|
|
58223
|
-
*
|
|
58224
|
-
* @param {Object} labelData - Dados da etiqueta
|
|
58225
|
-
* @param {string} [labelData.label_type] - Tipo da etiqueta
|
|
58226
|
-
* @param {string} [labelData.label_name] - Nome da etiqueta
|
|
58227
|
-
* @param {string} [labelData.label_content] - Conteúdo da etiqueta
|
|
58228
|
-
* @returns {Promise} Resposta da API
|
|
58229
|
-
*/
|
|
58230
|
-
static createLabel(labelData) {
|
|
58231
|
-
return __async(this, null, function* () {
|
|
58232
|
-
try {
|
|
58233
|
-
if (labelData.label_type) {
|
|
58234
|
-
this.validateLabelType(labelData.label_type, true);
|
|
58235
|
-
}
|
|
58236
|
-
const response = yield apiClient$1.post("/v1/label", labelData);
|
|
58237
|
-
return response.data;
|
|
58238
|
-
} catch (error) {
|
|
58239
|
-
throw new Error(`Erro ao criar etiqueta: ${error.message}`);
|
|
58240
|
-
}
|
|
58241
|
-
});
|
|
58242
|
-
}
|
|
58243
|
-
/**
|
|
58244
|
-
* Valida se o tipo de etiqueta é um dos tipos permitidos
|
|
58245
|
-
*
|
|
58246
|
-
* @param {string} labelType - Tipo de etiqueta a ser validado
|
|
58247
|
-
* @returns {boolean} True se for válido, false caso contrário
|
|
58248
|
-
* @throws {Error} Se o tipo for inválido e throwError for true
|
|
58249
|
-
*/
|
|
58250
|
-
static validateLabelType(labelType, throwError = false) {
|
|
58251
|
-
const isValid = Object.values(LABEL_TYPES$1).includes(labelType);
|
|
58252
|
-
if (!isValid && throwError) {
|
|
58253
|
-
throw new Error(`Tipo de etiqueta inválido: "${labelType}" não é um de part, scrap, thickened, input e volume.`);
|
|
58254
|
-
}
|
|
58255
|
-
return isValid;
|
|
58256
|
-
}
|
|
58257
|
-
/**
|
|
58258
|
-
* Retorna um tipo de etiqueta se for válido
|
|
58259
|
-
*
|
|
58260
|
-
* @param {string} labelType - Tipo de etiqueta a verificar
|
|
58261
|
-
* @returns {string} O tipo de etiqueta validado
|
|
58262
|
-
* @throws {Error} Se o tipo for inválido
|
|
58263
|
-
*/
|
|
58264
|
-
static labelByType(labelType) {
|
|
58265
|
-
this.validateLabelType(labelType, true);
|
|
58266
|
-
return labelType;
|
|
58267
|
-
}
|
|
58268
|
-
/**
|
|
58269
|
-
* Atualiza uma etiqueta existente
|
|
58270
|
-
* POST /v1/label (com label_id)
|
|
58271
|
-
*
|
|
58272
|
-
* @param {number} labelId - ID da etiqueta
|
|
58273
|
-
* @param {Object} labelData - Dados atualizados da etiqueta
|
|
58274
|
-
* @returns {Promise} Resposta da API
|
|
58275
|
-
*/
|
|
58276
|
-
static updateLabel(labelId, labelData) {
|
|
58277
|
-
return __async(this, null, function* () {
|
|
58278
|
-
try {
|
|
58279
|
-
if (labelData.label_type) {
|
|
58280
|
-
this.validateLabelType(labelData.label_type, true);
|
|
58281
|
-
}
|
|
58282
|
-
const response = yield apiClient$1.post("/v1/label", __spreadValues({
|
|
58283
|
-
label_id: labelId
|
|
58284
|
-
}, labelData));
|
|
58285
|
-
return response.data;
|
|
58286
|
-
} catch (error) {
|
|
58287
|
-
throw new Error(`Erro ao atualizar etiqueta ${labelId}: ${error.message}`);
|
|
58288
|
-
}
|
|
58289
|
-
});
|
|
58290
|
-
}
|
|
58291
|
-
/**
|
|
58292
|
-
* Remove uma etiqueta
|
|
58293
|
-
* DELETE /v1/label
|
|
58294
|
-
*
|
|
58295
|
-
* @param {number} labelId - ID da etiqueta
|
|
58296
|
-
* @returns {Promise} Resposta da API
|
|
58297
|
-
*/
|
|
58298
|
-
static deleteLabel(labelId) {
|
|
58299
|
-
return __async(this, null, function* () {
|
|
58300
|
-
try {
|
|
58301
|
-
const response = yield apiClient$1.delete("/v1/label", {
|
|
58302
|
-
params: { label_id: labelId }
|
|
58303
|
-
});
|
|
58304
|
-
return response.data;
|
|
58305
|
-
} catch (error) {
|
|
58306
|
-
throw new Error(`Erro ao deletar etiqueta ${labelId}: ${error.message}`);
|
|
58307
|
-
}
|
|
58308
|
-
});
|
|
58309
|
-
}
|
|
58310
|
-
/**
|
|
58311
|
-
* Configura o token de autenticação
|
|
58312
|
-
*
|
|
58313
|
-
* @param {string} token - Token de autenticação
|
|
58314
|
-
*/
|
|
58315
|
-
static setAuthToken(token2) {
|
|
58316
|
-
apiClient$1.defaults.headers.common["Authorization"] = `${token2}`;
|
|
58317
|
-
}
|
|
58318
|
-
/**
|
|
58319
|
-
* Remove o token de autenticação
|
|
58320
|
-
*/
|
|
58321
|
-
static removeAuthToken() {
|
|
58322
|
-
delete apiClient$1.defaults.headers.common["Authorization"];
|
|
58323
|
-
}
|
|
58324
|
-
/**
|
|
58325
|
-
* Configura a URL base da API
|
|
58326
|
-
*
|
|
58327
|
-
* @param {string} baseURL - Nova URL base
|
|
58328
|
-
*/
|
|
58329
|
-
static setBaseURL(baseURL) {
|
|
58330
|
-
apiClient$1.defaults.baseURL = baseURL;
|
|
58331
|
-
}
|
|
58332
|
-
}
|
|
58333
58333
|
function getTemplateById(templateId) {
|
|
58334
58334
|
return __async(this, null, function* () {
|
|
58335
58335
|
try {
|
|
@@ -58651,6 +58651,7 @@ function normalizeLabelData(labelData) {
|
|
|
58651
58651
|
});
|
|
58652
58652
|
}
|
|
58653
58653
|
const init = (config = {}) => {
|
|
58654
|
+
console.log(config);
|
|
58654
58655
|
if (config.defaultTransformer) {
|
|
58655
58656
|
const { fieldMap, fieldMapSource } = config.defaultTransformer;
|
|
58656
58657
|
if (!["legacy", "custom", "none"].includes(fieldMap)) {
|
|
@@ -58667,9 +58668,10 @@ const init = (config = {}) => {
|
|
|
58667
58668
|
autoConnectPrinter: true
|
|
58668
58669
|
}, config);
|
|
58669
58670
|
globalConfig = __spreadValues(__spreadValues({}, globalConfig), finalConfig);
|
|
58670
|
-
|
|
58671
|
-
|
|
58672
|
-
|
|
58671
|
+
console.log(globalConfig);
|
|
58672
|
+
if (globalConfig.token) {
|
|
58673
|
+
console.log("🔑 Atualizando token da API", globalConfig.token);
|
|
58674
|
+
updateApiToken(globalConfig.token);
|
|
58673
58675
|
}
|
|
58674
58676
|
if (finalConfig.autoConnectPrinter) {
|
|
58675
58677
|
try {
|
|
@@ -59322,7 +59324,6 @@ const LABEL_TYPES = {
|
|
|
59322
59324
|
INPUT: "input",
|
|
59323
59325
|
VOLUME: "volume"
|
|
59324
59326
|
};
|
|
59325
|
-
const apiClient = null;
|
|
59326
59327
|
const getPartLabels = null;
|
|
59327
59328
|
const getScrapLabels = null;
|
|
59328
59329
|
const getThickenedLabels = null;
|
|
@@ -59337,70 +59338,69 @@ const EtiquetasJS = __spreadProps(__spreadValues({}, etiquetasAPI), {
|
|
|
59337
59338
|
}
|
|
59338
59339
|
});
|
|
59339
59340
|
export {
|
|
59340
|
-
|
|
59341
|
-
|
|
59342
|
-
|
|
59343
|
-
|
|
59344
|
-
|
|
59341
|
+
getAspectRatio as $,
|
|
59342
|
+
etiquetasAPI as A,
|
|
59343
|
+
isBrowser as B,
|
|
59344
|
+
isNodeJS$1 as C,
|
|
59345
|
+
createBrowserCanvas as D,
|
|
59345
59346
|
EtiquetasJS as E,
|
|
59346
|
-
|
|
59347
|
-
|
|
59348
|
-
|
|
59349
|
-
|
|
59350
|
-
|
|
59351
|
-
|
|
59347
|
+
loadImageBrowser as F,
|
|
59348
|
+
createBrowserDOM as G,
|
|
59349
|
+
downloadFile as H,
|
|
59350
|
+
serializeXML as I,
|
|
59351
|
+
createBuffer as J,
|
|
59352
|
+
base64Encode as K,
|
|
59352
59353
|
LABEL_TYPES as L,
|
|
59353
|
-
|
|
59354
|
-
|
|
59355
|
-
|
|
59356
|
-
|
|
59357
|
-
|
|
59358
|
-
|
|
59359
|
-
|
|
59360
|
-
|
|
59361
|
-
|
|
59362
|
-
|
|
59363
|
-
|
|
59364
|
-
|
|
59365
|
-
|
|
59366
|
-
|
|
59354
|
+
base64Decode as M,
|
|
59355
|
+
processLabelForParts as N,
|
|
59356
|
+
convertPdfToImages as O,
|
|
59357
|
+
checkPrinterAvailability as P,
|
|
59358
|
+
sendImagesToPrinter as Q,
|
|
59359
|
+
downloadPdfFallback as R,
|
|
59360
|
+
createMiniSheet as S,
|
|
59361
|
+
createImage as T,
|
|
59362
|
+
createImageFromPart as U,
|
|
59363
|
+
drawRect as V,
|
|
59364
|
+
setBorder as W,
|
|
59365
|
+
getBorderColor as X,
|
|
59366
|
+
makeLamination as Y,
|
|
59367
|
+
getNode as Z,
|
|
59367
59368
|
_typeof as _,
|
|
59368
|
-
|
|
59369
|
-
|
|
59370
|
-
|
|
59371
|
-
|
|
59372
|
-
|
|
59373
|
-
|
|
59374
|
-
|
|
59375
|
-
|
|
59376
|
-
|
|
59377
|
-
|
|
59378
|
-
|
|
59379
|
-
|
|
59380
|
-
getPartLabels as b,
|
|
59369
|
+
getPartLabels as a,
|
|
59370
|
+
DEFAULT_LAMINATION_COLORS as a0,
|
|
59371
|
+
stopCreatingLabels as a1,
|
|
59372
|
+
initializeBrowserEnvironment as a2,
|
|
59373
|
+
getImagesFromUrl as a3,
|
|
59374
|
+
getImagesFromUrlToBase64 as a4,
|
|
59375
|
+
mmToPx as a5,
|
|
59376
|
+
convertSVGTableToAutoTableData as a6,
|
|
59377
|
+
generateTableSVG as a7,
|
|
59378
|
+
dataTypeList as a8,
|
|
59379
|
+
getInputsByCategory as a9,
|
|
59380
|
+
getScrapLabels as b,
|
|
59381
59381
|
commonjsGlobal as c,
|
|
59382
|
-
|
|
59383
|
-
|
|
59384
|
-
|
|
59382
|
+
getThickenedLabels as d,
|
|
59383
|
+
getInputLabels as e,
|
|
59384
|
+
getVolumeLabels as f,
|
|
59385
59385
|
getDefaultExportFromCjs as g,
|
|
59386
|
-
|
|
59387
|
-
|
|
59388
|
-
|
|
59389
|
-
|
|
59390
|
-
|
|
59391
|
-
|
|
59392
|
-
|
|
59393
|
-
|
|
59394
|
-
|
|
59395
|
-
|
|
59386
|
+
LabelWorker as h,
|
|
59387
|
+
createLabelWorker as i,
|
|
59388
|
+
generateLabelsFromHookData as j,
|
|
59389
|
+
useLabelStore as k,
|
|
59390
|
+
getPartsForLabels as l,
|
|
59391
|
+
getInputForLabels as m,
|
|
59392
|
+
getPartsFromProjectToLabels as n,
|
|
59393
|
+
labelTypeNames as o,
|
|
59394
|
+
initialState as p,
|
|
59395
|
+
LabelsAPI as q,
|
|
59396
59396
|
reducer as r,
|
|
59397
|
-
|
|
59398
|
-
|
|
59397
|
+
init as s,
|
|
59398
|
+
getPrinterStatus as t,
|
|
59399
59399
|
useLabelData as u,
|
|
59400
|
-
|
|
59401
|
-
|
|
59402
|
-
|
|
59403
|
-
|
|
59404
|
-
|
|
59400
|
+
makeLabel as v,
|
|
59401
|
+
sendLabel as w,
|
|
59402
|
+
downloadPDF as x,
|
|
59403
|
+
sendToPrinter as y,
|
|
59404
|
+
validateLabelData as z
|
|
59405
59405
|
};
|
|
59406
|
-
//# sourceMappingURL=index-
|
|
59406
|
+
//# sourceMappingURL=index-Tvy8FVsM.js.map
|