PageSourceSearch

https://otentecnologia.com.br/assets/Settings-PDftq5cE.js

js otentecnologia.com.br collected 2026-09-30 05:28:56 UTC 118,769 bytes, 1 lines download raw bytes

1import{g as e,r as t,j as r,c as o}from"./framer-DNXtdBgj.js";import{B as n,L as a,e as i,bc as s,u as l,bb as c,v as u,aQ as d,I as p,M as h,q as f,P as m,aP as v,aR as g,aT as y,aX as x,aW as b}from"./index-XTUkK5WH.js";import{u as w}from"./useMutation-DcVFqQKd.js";import{A as j}from"./AdminLayout-DLcnHFvP.js";import{T as _}from"./textarea-x1LPr9Af.js";import{L as S}from"./label-DF-Tz1WR.js";import{C,a as N,b as E,e as P,c as k}from"./card-Bfb46Kgw.js";import{T as R,a as O,b as z,c as U}from"./tabs-C-yQPmQF.js";import{C as T}from"./checkbox-DH4QSwLU.js";import{S as D,a as L,b as A,c as M,d as I}from"./select-DQMgvcBO.js";import{B as F}from"./badge-5FdbKFYY.js";import{S as q}from"./SitemapRobotsTab-CfhGxQl7.js";import{I as H}from"./ImageUpload-BWGuMGxs.js";import{d as W,_ as G}from"./supabase-CVkO6afG.js";import{D as B,a as V,b as Z,c as $,f as X}from"./dialog-CCYtSJ9h.js";import{S as K}from"./slider-BqJNKmbm.js";import{T as Y}from"./trash-2-CSXn37pz.js";import{P as J}from"./plus-BWMdkkfo.js";import{S as Q}from"./save-Buqk_0cO.js";import{C as ee}from"./users-round-C_OE1rsU.js";import{V as te}from"./video-CHR9136P.js";import{U as re}from"./upload-BR5n0rOG.js";import{L as oe}from"./link-DeKx1FCi.js";import"./file-text-IPr1Bv1X.js";import"./rocket-Ckmnaf0E.js";import"./wrench-k69Xhg9M.js";import"./factory-g-lDNgT_.js";import"./target-CQCdL--z.js";import"./package-BE07Fgma.js";import"./puzzle-ms8g5hLX.js";import"./building-2-Cf048s_3.js";import"./users-BomTj5bm.js";import"./chart-column-x2tYRpNA.js";import"./index-jVOyRz7F.js";import"./chevron-up-Z5mg4Tbw.js";import"./external-link-CHm8ztBE.js";import"./refresh-cw-BQas9oJM.js";import"./rotate-ccw-C2WGqzDI.js";import"./triangle-alert-DJSRqaL7.js";import"./copy-DvFQ8OQF.js";import"./download-CV2HsLSX.js";import"./mediaFilters-FdJccz9J.js";import"./search-B3aOT83d.js";var ne,ae,ie,se,le,ce,ue,de,pe,he,fe,me,ve,ge,ye,xe=!1;function be(){if(!xe){xe=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Ice
1weasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),r=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(me=/\b(iPhone|iP[ao]d)/.exec(e),ve=/\b(iP[ao]d)/.exec(e),he=/Android/i.exec(e),ge=/FBAN\/\w+;/i.exec(e),ye=/Mobile/i.exec(e),fe=!!/Win64/.exec(e),t){(ne=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(ne=document.documentMode);var o=/(?:Trident\/(\d+.\d+))/.exec(e);ce=o?parseFloat(o[1])+4:ne,ae=t[2]?parseFloat(t[2]):NaN,ie=t[3]?parseFloat(t[3]):NaN,(se=t[4]?parseFloat(t[4]):NaN)?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),le=t&&t[1]?parseFloat(t[1]):NaN):le=NaN}else ne=ae=ie=le=se=NaN;if(r){if(r[1]){var n=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);ue=!n||parseFloat(n[1].replace("_","."))}else ue=!1;de=!!r[2],pe=!!r[3]}else ue=de=pe=!1}}var we,je={ie:function(){return be()||ne},ieCompatibilityMode:function(){return be()||ce>ne},ie64:function(){return je.ie()&&fe},firefox:function(){return be()||ae},opera:function(){return be()||ie},webkit:function(){return be()||se},safari:function(){return je.webkit()},chrome:function(){return be()||le},windows:function(){return be()||de},osx:function(){return be()||ue},linux:function(){return be()||pe},iphone:function(){return be()||me},mobile:function(){return be()||me||ve||he||ye},nativeApp:function(){return be()||ge},android:function(){return be()||he},ipad:function(){return be()||ve}},_e=je,Se=!("undefined"==typeof window||!window.document||!window.document.createElement),Ce=Se;Se&&!window.addEventListener&&window,Se&&window;Ce&&(we=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var Ne=_e;function Ee(e){var t=0,r=0,o=0,n=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),o=10*t,n=10*r,"deltaY"in e&&(n=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||n)&&e.deltaMode&&(1==e.deltaMode?(o*=40,n*=40):(o*=800,n*=800)),o&&!t&&(t=1>o?-1:1),n&&!r&&(r=1>n?-1:1),{spinX:t,spinY:r,pixelX:o,pixelY:n}}Ee.getEventType=function(){return Ne.firefox()?"DOMMouseScroll":function(e,t){if(!Ce||t&&!("addEventListener"in document))return!1;var r="on"+e,o=r in document;if(!o){var n=document.createElement("div");n.setAttribute(r,"return;"),o="function"==typeof n[r]}return!o&&we&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}("wheel")?"wheel":"mousewheel"};const Pe=e(Ee);function ke(e,t,r,o,n){void 0===n&&(n=0);var a=Le(t.width,t.height,n),i=a.height;return{x:Re(e.x,a.width,r.width,o),y:Re(e.y,i,r.height,o)}}function Re(e,t,r,o){var n=Math.abs(t*o/2-r/2);return Ae(e,-n,n)}function Oe(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ze(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Ue(e,t){return Math.min(e,Math.max(0,t))}function Te(e,t){return t}function De(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Le(e,t,r){var o=r*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function Ae(e,t,r){return Math.min(Math.max(e,t),r)}function Me(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&e.length>0}).join(" ").trim()}var Ie=function(e){function r(){var o=null!==e&&e.apply(this,arguments)||this;return o.cropperRef=t.createRef(),o.imageRef=t.createRef(),o.videoRef=t.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc="undefined"!=typeof document?document:null,o.currentWindow="undefined"!=typeof window?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&o.containerRef){var e=!0;o.resizeObserver=new window.ResizeObserver(function(t){e?e=!1:o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(e){return e.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var e=o.computeSizes();e&&(o.previousCropSize=e,o.emitCropData(),o.setInitialCrop(e),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(e){if(o.props.initialCroppedAreaPercentages){var t=function(e,t,r,o,n,a){var i=Le(t.width,t.height,r),s=Ae(o.width/i.width*(100/e.width),n,a);return{crop:{x:s*i.width/2-o.width/2-i.width*s*(e.x/100),y:s*i.height/2-o.height/2-i.height*s*(e.y/100)},zoom:s}}(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom),r=t.zoom;o.props.onCropChange(t.crop),o.props.onZoomChange&&o.props.onZoomChange(r)}else if(o.props.initialCroppedAreaPixels){var n=function(e,t,r,o,n,a){void 0===r&&(r=0);
1var i=Le(t.naturalWidth,t.naturalHeight,r),s=Ae(function(e,t,r){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return r.height>r.width?r.height/(e.height*o):r.width/(e.width*o)}(e,t,o),n,a),l=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*l,y:((i.height-e.height)/2-e.y)*l},zoom:s}}(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom);r=n.zoom,o.props.onCropChange(n.crop),o.props.onZoomChange&&o.props.onZoomChange(r)}},o.computeSizes=function(){var e,t,r,n,a,i,s=o.imageRef.current||o.videoRef.current;if(s&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var l=o.containerRect.width/o.containerRect.height,c=(null===(e=o.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=o.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=o.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(n=o.videoRef.current)||void 0===n?void 0:n.videoHeight)||0,d=c/u,p=void 0;if(c>s.offsetWidth||u>s.offsetHeight)switch(o.state.mediaObjectFit){default:case"contain":p=l>d?{width:o.containerRect.height*d,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/d};break;case"horizontal-cover":p={width:o.containerRect.width,height:o.containerRect.width/d};break;case"vertical-cover":p={width:o.containerRect.height*d,height:o.containerRect.height}}else p={width:s.offsetWidth,height:s.offsetHeight};o.mediaSize=G(G({},p),{naturalWidth:c,naturalHeight:u}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var h=o.props.cropSize?o.props.cropSize:function(e,t,r,o,n,a){void 0===a&&(a=0);var i=Le(e,t,a),s=i.height,l=Math.min(i.width,r),c=Math.min(s,o);return l>c*n?{width:c*n,height:c}:{width:l,height:l/n}}(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(null===(a=o.state.cropSize)||void 0===a?void 0:a.height)===h.height&&(null===(i=o.state.cropSize)||void 0===i?void 0:i.width)===h.width||o.props.onCropSizeChange&&o.props.onCropSizeChange(h),o.setState({cropSize:h},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(h),h}},o.saveContainerPosition=function(){if(o.containerRef){var e=o.containerRef.getBoundingClientRect();o.containerPosition={x:e.left,y:e.top}}},o.onMouseDown=function(e){o.currentDoc&&(e.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(r.getMousePoint(e)))},o.onMouseMove=function(e){return o.onDrag(r.getMousePoint(e))},o.onScroll=function(e){o.currentDoc&&(e.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(e){o.currentDoc&&(o.isTouching=!0,o.props.onTouchRequest&&!o.props.onTouchRequest(e)||(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),2===e.touches.length?o.onPinchStart(e):1===e.touches.length&&o.onDragStart(r.getTouchPoint(e.touches[0]))))},o.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?o.onPinchMove(e):1===e.touches.length&&o.onDrag(r.getTouchPoint(e.touches[0]))},o.onGestureStart=function(e){o.currentDoc&&(e.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(e){if(e.preventDefault(),!o.isTouching){var t=r.getMousePoint(e);o.setNewZoom(o.gestureZoomStart-1+e.scale,t,{shouldUpdatePosition:!0}),o.props.onRotationChange&&o.props.onRotationChange(o.gestureRotationStart+e.rotation)}},o.onGestureEnd=function(e){o.cleanEvents()},o.onDragStart=function(e){var t,r;o.dragStartPosition={x:e.x,y:e.y},o.dragStartCrop=G({},o.props.crop),null===(r=(t=o.props).onInteractionStart)||void 0===r||r.call(t)},o.onDrag=function(e){var t=e.x,r=e.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&void 0!==t&&void 0!==r){var e={x:o.dragStartCrop.x+(t-o.dragStartPosition.x),y:o.dragStartCrop.y+(r-o.dragStartPosition.y)},n=o.props.restrictPosition?ke(e,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):e;o.props.onCropChange(n)}}))},o.onDragStopped=function(){var e,t;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),null===(t=(e=o.props).onInteractionEnd)||void 0===t||t.call(e)},o.onWheel=function(e){if(o.currentWindow&&(!o.props.onWheelRequest||o.props.onWheelRequest(e))){e.preventDefault();var t=r.getMousePoint(e),n=Pe(e).pixelY;o.setNewZoom(o.props.zoom-n*o.props.zoomSpeed/200,t,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var e,t;return null===(t=(e=o.props).onInteractionStart)||void 0===t?void 0:t.call(e)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var e,t;return null===(t=(e=o.props).onInteractionEnd)||void 0===t?void 0:t.call(e)})},250)}},o.getPointOnContainer=function(e,t){var r=e.x,n=e.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(r-t.x),y:o.containerRect.height/2-(n-t.y)}},o.getPointOnMedia=function(e){var t=o.props,r=t.crop,n=t.zoom;return{x:(e.x+r.x)/n,y:(e.y+r.y)/n}},o.setNewZoom=function(e,t,r){var n=(void 0===r?{}:r).shouldUpdatePosition,a=void 0===n||n;
1if(o.state.cropSize&&o.props.onZoomChange){var i=Ae(e,o.props.minZoom,o.props.maxZoom);if(a){var s=o.getPointOnContainer(t,o.containerPosition),l=o.getPointOnMedia(s),c={x:l.x*i-s.x,y:l.y*i-s.y},u=o.props.restrictPosition?ke(c,o.mediaSize,o.state.cropSize,i,o.props.rotation):c;o.props.onCropChange(u)}o.props.onZoomChange(i)}},o.getCropData=function(){return o.state.cropSize?function(e,t,r,o,n,a,i){void 0===a&&(a=0),void 0===i&&(i=!0);var s=i?Ue:Te,l=Le(t.width,t.height,a),c=Le(t.naturalWidth,t.naturalHeight,a),u={x:s(100,((l.width-r.width/n)/2-e.x/n)/l.width*100),y:s(100,((l.height-r.height/n)/2-e.y/n)/l.height*100),width:s(100,r.width/l.width*100/n),height:s(100,r.height/l.height*100/n)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),h=c.height*o>c.width?{width:d,height:Math.round(d/o)}:{width:Math.round(p*o),height:p};return{croppedAreaPercentages:u,croppedAreaPixels:G(G({},h),{x:Math.round(s(c.width-h.width,u.x*c.width/100)),y:Math.round(s(c.height-h.height,u.y*c.height/100))})}}(o.props.restrictPosition?ke(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition):null},o.emitCropData=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(t,r),o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.emitCropAreaChange=function(){var e=o.getCropData();e&&o.props.onCropAreaChange&&o.props.onCropAreaChange(e.croppedAreaPercentages,e.croppedAreaPixels)},o.recomputeCropPosition=function(){var e,t;if(o.state.cropSize){var r=o.props.crop;o.isInitialized&&(null===(e=o.previousCropSize)||void 0===e?void 0:e.width)&&(null===(t=o.previousCropSize)||void 0===t?void 0:t.height)&&(Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6)&&(r={x:o.props.crop.x*(o.state.cropSize.width/o.previousCropSize.width),y:o.props.crop.y*(o.state.cropSize.height/o.previousCropSize.height)});var n=o.props.restrictPosition?ke(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(n),o.emitCropData()}},o.onKeyDown=function(e){var t,r,n=o.props,a=n.onCropChange,i=n.zoom,s=n.rotation,l=n.keyboardStep;if(o.state.cropSize){e.shiftKey&&(l*=.2);var c=G({},n.crop);switch(e.key){case"ArrowUp":c.y-=l,e.preventDefault();break;case"ArrowDown":c.y+=l,e.preventDefault();break;case"ArrowLeft":c.x-=l,e.preventDefault();break;case"ArrowRight":c.x+=l,e.preventDefault();break;default:return}o.props.restrictPosition&&(c=ke(c,o.mediaSize,o.state.cropSize,i,s)),e.repeat||null===(r=(t=o.props).onInteractionStart)||void 0===r||r.call(t),a(c)}},o.onKeyUp=function(e){var t,r;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}o.emitCropData(),null===(r=(t=o.props).onInteractionEnd)||void 0===r||r.call(t)},o}return W(r,e),r.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}
1\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},r.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},r.prototype.componentDidUpdate=function(e){var t,r,o,n,a,i,s,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.width)?this.computeSizes():(null===(a=e.crop)||void 0===a?void 0:a.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},r.prototype.getAspect=function(){var e=this.props,t=e.cropSize;return t?t.width/t.height:e.aspect},r.prototype.getObjectFit=function(){var e,t,r,o;return"cover"===this.props.objectFit?(this.imageRef.current||this.videoRef.current)&&this.containerRef?(this.containerRect=this.containerRef.getBoundingClientRect(),this.containerRect.width/this.containerRect.height>((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(r=this.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=this.videoRef.current)||void 0===o?void 0:o.videoHeight)||0)?"horizontal-cover":"vertical-cover"):"horizontal-cover":this.props.objectFit},r.prototype.onPinchStart=function(e){var t=r.getTouchPoint(e.touches[0]),o=r.getTouchPoint(e.touches[1]);this.lastPinchDistance=Oe(t,o),this.lastPinchRotation=ze(t,o),this.onDragStart(De(t,o))},r.prototype.onPinchMove=function(e){var t=this;if(this.currentDoc&&this.currentWindow){var o=r.getTouchPoint(e.touches[0]),n=r.getTouchPoint(e.touches[1]),a=De(o,n);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=Oe(o,n);t.setNewZoom(t.props.zoom*(e/t.lastPinchDistance),a,{shouldUpdatePosition:!1}),t.lastPinchDistance=e;var r=ze(o,n);t.props.onRotationChange&&t.props.onRotationChange(t.props.rotation+(r-t.lastPinchRotation)),t.lastPinchRotation=r})}},r.prototype.render=function(){var e,r=this,o=this.props,n=o.image,a=o.video,i=o.mediaProps,s=o.cropperProps,l=o.transform,c=o.crop,u=c.x,d=c.y,p=o.rotation,h=o.zoom,f=o.cropShape,m=o.showGrid,v=o.roundCropAreaPixels,g=o.style,y=g.containerStyle,x=g.cropAreaStyle,b=g.mediaStyle,w=o.classes,j=w.containerClassName,_=w.cropAreaClassName,S=w.mediaClassName,C=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return t.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return r.containerRef
1=e},"data-testid":"container",style:y,className:Me("reactEasyCrop_Container",j)},n?t.createElement("img",G({alt:"",className:Me("reactEasyCrop_Image","contain"===C&&"reactEasyCrop_Contain","horizontal-cover"===C&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===C&&"reactEasyCrop_Cover_Vertical",S)},i,{src:n,ref:this.imageRef,style:G(G({},b),{transform:l||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):a&&t.createElement("video",G({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:Me("reactEasyCrop_Video","contain"===C&&"reactEasyCrop_Contain","horizontal-cover"===C&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===C&&"reactEasyCrop_Cover_Vertical",S)},i,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:G(G({},b),{transform:l||"translate(".concat(u,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(e){return t.createElement("source",G({key:e.src},e))})),this.state.cropSize&&t.createElement("div",G({ref:this.cropperRef,style:G(G({},x),{width:v?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:v?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:Me("reactEasyCrop_CropArea","round"===f&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",_)},s)))},r.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},r.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},r.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},r}(t.Component);function Fe({open:e,onOpenChange:o,imageUrl:l,aspect:c=1200/630,outputWidth:u=1200,outputHeight:d=630,bucket:p="media",folder:h="seo/og",onCropped:f}){const[m,v]=t.useState({x:0,y:0}),[g,y]=t.useState(1),[x,b]=t.useState(null),[w,j]=t.useState(!1),_=t.useCallback((e,t)=>{b(t)},[]);return r.jsx(B,{open:e,onOpenChange:o,children:r.jsxs(V,{className:"max-w-2xl",children:[r.jsx(Z,{children:r.jsxs($,{children:["Recortar imagem (",u,"x",d,")"]})}),r.jsx("div",{className:"relative w-full h-[400px] bg-muted rounded-md overflow-hidden",children:l&&r.jsx(Ie,{image:l,crop:m,zoom:g,aspect:c,onCropChange:v,onZoomChange:y,onCropComplete:_})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Zoom"}),r.jsx(K,{value:[g],min:1,max:4,step:.05,onValueChange:e=>y(e[0])})]}),r.jsxs(X,{children:[r.jsx(n,{variant:"outline",onClick:()=>o(!1),disabled:w,children:"Cancelar"}),r.jsxs(n,{onClick:async()=>{if(x&&l){j(!0);try{const e=await async function(e,t,r,o){const n=await async function(e){return new Promise((t,r)=>{const o=new Image;o.crossOrigin="anonymous",o.onload=()=>t(o),o.onerror=r,o.src=e})}(e),a=document.createElement("canvas");a.width=r,a.height=o;const i=a.getContext("2d");if(!i)throw new Error("Canvas context unavailable");return i.drawImage(n,t.x,t.y,t.width,t.height,0,0,r,o),new Promise((e,t)=>{a.toBlob(r=>r?e(r):t(new Error("Falha ao gerar imagem")),"image/webp",.9)})}(l,x,u,d),t=`${h}/${Date.now()}-${Math.random().toString(36).substring(7)}.webp`,{error:r}=await i.storage.from(p).upload(t,e,{cacheControl:"3600",upsert:!1,contentType:"image/webp"});if(r)throw r;const{data:n}=i.storage.from(p).getPublicUrl(t);try{await i.from("media").insert({filename:`og-${u}x${d}.webp`,url:n.publicUrl,type:"image/webp",size:e.size})}catch{}f(n.publicUrl),s.success("Imagem recortada e salva"),o(!1)}catch(e){console.error(e),s.error(e.message||"Falha ao recortar imagem")}finally{j(!1)}}},disabled:w||!x,children:[w?r.jsx(a,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Salvar recorte"]})]})]})})}function qe(e){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function He(e){var t="function"==typeof Map?new Map:void 0;return He=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(We())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var n=new(e.bind.apply(e,o));return r&&Ge(n,r.prototype),n}(e,arguments,Be(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ge(r,e)},He(e)}function We(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(We=function(){return!!e})()}function Ge(e,t){return(Ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Be(e){return(Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ve=function(){function e(t){var r,o,n,a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(o=this,n=e,a=[t],n=Be(n),r=function(e,t){if(t&&("object"===qe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(o,We()?Reflect.construct(n,a||[],Be(o).constructor):n.apply(o,a))).originalRequest=s,r.originalResponse=l,r.causingError=i,null!=i&&(t+=", caused by ".concat(i.toString())),null!=s){var c=s.getHeader("X-Request-ID")||"n/a",u=s.getMethod(),d=s.getURL(),p=l?l.getStatus():"n/a",h=l?l.getBody()||"":"n/a";t+=", originated from request (method: ".concat(u,", url: ").concat(d,", response code: ").concat(p,", response text: ").concat(h,", request id: ").concat(c,")")}return r.message=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ge(e,t)}(e,He(Error)),t=e,Object.defineProperty(t,"prototype",{writable:!1}),t;var t}();function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e){var t=function(e){if("object"!=Ze(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ze(t)?t:t+""}var Xe=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve([])}},{key:"removeUpload",value:function(e){return Promise.resolve()}},{key:"addUpload",value:function(e,t){return Promise.resolve(null)}}])&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,$e(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();const Ke="function"==typeof Buffer,Ye=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Je=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/="),Qe=((()=>{let e={};Je.forEach((t,r)=>e[t]=r)})(),String.fromCharCode.bind(String)),et=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),tt="function"==typeof btoa?e=>btoa(e):Ke?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,r,o,n,a="";const i=e.length%3;for(let s=0;e.length>s;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|o<<8|n,a+=Je[t>>18&63]+Je[t>>12&63]+Je[t>>6&63]+Je[63&t]}return i?a.slice(0,i-3)+"===".substring(i):a},rt=Ke?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,o=e.length;o>r;r+=4096)t.push(Qe.apply(null,e.subarray(r,r+4096)));return tt(t.join(""))},ot=e=>{if(2>e.length)return 128>(t=e.charCodeAt(0))?e:2048>t?Qe(192|t>>>6)+Qe(128|63&t):Qe(224|t>>>12&15)+Qe(128|t>>>6&63)+Qe(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Qe(240|t>>>18&7)+Qe(128|t>>>12&63)+Qe(128|t>>>6&63)+Qe(128|63&t)},nt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,at=Ke?e=>Buffer.from(e,"utf8").toString("base64"):Ye?e=>rt(Ye.encode(e)):e=>tt(e.replace(nt,ot)),it=(e,t=!1)=>t?et(at(e)):at(e);var st={},lt=Object.prototype.hasOwnProperty;function ct(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function ut(e){try{return encodeURIComponent(e)}catch(t){return null}}st.stringify=function(e,t){t=t||"";var r,o,n=[];for(o in"string"!=typeof t&&(t="?"),e)if(lt.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=ut(o),r=ut(r),null===o||null===r)continue;n.push(o+"="+r)}return n.length?t+n.join("&"):""},st.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,o={};t=r.exec(e);){var n=ct(t[1]),a=ct(t[2]);null===n||null===a||n in o||(o[n]=a)}return o};var dt=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},pt=st,ht=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,ft=/[\n\r\t]/g,mt=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,vt=/:\d+$/,gt=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,yt=/^[a-zA-Z]:/;function xt(e){return(e||"").toString().replace(ht,"")}var bt=[["#","hash"],["?","query"],function(e,t){return _t(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],wt={hash:1,query:1};function jt(e){var t;t="undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{};var r,n={},a=typeof(e=e||t.location||{});if("blob:"===e.protocol)n=new Ct(unescape(e.pathname),{});else if("string"===a)for(r in n=new Ct(e,{}),wt)delete n[r];else if("object"===a){for(r in e)r in wt||(n[r]=e[r]);void 0===n.slashes&&(n.slashes=mt.test(e.href))}return n}function _t(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function St(e,t){e=(e=xt(e)).replace(ft,""),t=t||{};var r,o=gt.exec(e),n=o[1]?o[1].toLowerCase():"",a=!!o[2],i=!!o[3],s=0;return a?i?(r=o[2]+o[3]+o[4],s=o[2].length+o[3].length):(r=o[2]+o[4],s=o[2].length):i?(r=o[3]+o[4],s=o[3].length):r=o[4],"file:"===n?2>s||(r=r.slice(2)):_t(n)?r=o[4]:n?a&&(r=r.slice(2)):s>=2&&_t(t.protocol)&&(r=o[4]),{protocol:n,slashes:a||_t(n),slashesCount:s,rest:r}}function Ct(e,t,r){if(e=(e=xt(e)).replace(ft,""),!(this instanceof Ct))return new Ct(e,t,r);var o,n,a,i,s,l,c=bt.slice(),u=typeof t,d=this,p=0;for("object"!==u&&"string"!==u&&(r=t,t=null),r&&"function"!=typeof r&&(r=pt.parse),o=!(n=St(e||"",t=jt(t))).protocol&&!n.slashes,d.slashes=n.slashes||o&&t.slashes,d.protocol=n.protocol||t.protocol||"",e=n.rest,("file:"===n.protocol&&(2!==n.slashesCount||yt.test(e))||!n.slashes&&(n.protocol||2>n.slashesCount||!_t(d.protocol)))&&(c[3]=[/(.*)/,"pathname"]);c.length>p;p++)"function"!=typeof(i=c[p])?(l=i[1],(a=i[0])!=a?d[l]=e:"string"==typeof a?~(s="@"===a?e.lastIndexOf(a):e.indexOf(a))&&("number"==typeof i[2]?(d[l]=e.slice(0,s),e=e.slice(s+i[2])):(d[l]=e.slice(s),e=e.slice(0,s))):(s=a.exec(e))&&(d[l]=s[1],e=e.slice(0,s.index)),d[l]=d[l]||o&&i[3]&&t[l]||"",i[4]&&(d[l]=d[l].toLowerCase())):e=i(e,d);
1r&&(d.query=r(d.query)),o&&t.slashes&&"/"!==d.pathname.charAt(0)&&(""!==d.pathname||""!==t.pathname)&&(d.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],a=!1,i=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),i++):i&&(0===o&&(a=!0),r.splice(o,1),i--);return a&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}(d.pathname,t.pathname)),"/"!==d.pathname.charAt(0)&&_t(d.protocol)&&(d.pathname="/"+d.pathname),dt(d.port,d.protocol)||(d.host=d.hostname,d.port=""),d.username=d.password="",d.auth&&(~(s=d.auth.indexOf(":"))?(d.username=d.auth.slice(0,s),d.username=encodeURIComponent(decodeURIComponent(d.username)),d.password=d.auth.slice(s+1),d.password=encodeURIComponent(decodeURIComponent(d.password))):d.username=encodeURIComponent(decodeURIComponent(d.auth)),d.auth=d.password?d.username+":"+d.password:d.username),d.origin="file:"!==d.protocol&&_t(d.protocol)&&d.host?d.protocol+"//"+d.host:"null",d.href=d.toString()}Ct.prototype={set:function(e,t,r){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||pt.parse)(t)),o[e]=t;break;case"port":o[e]=t,dt(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,vt.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(t){var n="pathname"===e?"/":"#";o[e]=t.charAt(0)!==n?n+t:t}else o[e]=t;break;case"username":case"password":o[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(o.username=t.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=t.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(t))}for(var i=0;bt.length>i;i++){var s=bt[i];s[4]&&(o[s[1]]=o[s[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&_t(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=pt.stringify);var t,r=this,o=r.host,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var a=n+(r.protocol&&r.slashes||_t(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):"file:"!==r.protocol&&_t(r.protocol)&&!o&&"/"!==r.pathname&&(a+="@"),(":"===o[o.length-1]||vt.test(r.hostname)&&!r.port)&&(o+=":"),a+=o+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(a+=r.hash),a}},Ct.extractProtocol=St,Ct.location=jt,Ct.trimLeft=xt,Ct.qs=pt;const Nt=e(Ct);function Et(){Et=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(z){c=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var a=Object.create((t&&t.prototype instanceof g?t:g).prototype),i=new R(o||[]);return n(a,"_invoke",{value:N(e,r,i)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(o){return{type:"throw",arg:o}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",m="completed",v={};function g(){}function y(){}function x(){}var b={};c(b,i,function(){return this});var w=Object.getPrototypeOf,j=w&&w(w(O([])));j&&j!==r&&o.call(j,i)&&(b=j);var _=x.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function C(e,t){function r(n,a,i,s){var l=d(e[n],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Rt(u)&&o.call(u,"__await")?t.resolve(u.__await).then(function(e){r("next",e,i,s)},function(e){r("throw",e,i,s)}):t.resolve(u).then(function(e){c.value=e,i(c)},function(e){return r("throw",e,i,s)})}s(l.arg)}var a;n(this,"_invoke",{value:function(e,o){function n(){return new t(function(t,n){r(e,o,t,n)})}return a=a?a.then(n,n):n()}})}function N(t,r,o){var n=p;return function(a,i){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===a)throw i;return{value:e,done:!0}}for(o.method=a,o.arg=i;;){var s=o.delegate;if(s){var l=E(s,o);if(l){if(l===v)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===p)throw n=m,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=f;var c=d(t,r,o);if("normal"===c.type){if(n=o.done?m:h,c.arg===v)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(n=m,o.method="throw",o.arg=c.arg)}}}function E(t,r){var o=r.method,n=t.iterator[o];if(n===e)return r.delegate=null,"throw"===o&&t.iterator.return&&
vendor: 4,704 bytes, line 1
1(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var a=d(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(Rt(t)+" is not iterable")}return y.prototype=x,n(_,"constructor",{value:x,configurable:!0}),n(x,"constructor",{value:y,configurable:!0}),y.displayName=c(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},S(C.prototype),c(C.prototype,s,function(){return this}),t.AsyncIterator=C,t.async=function(e,r,o,n,a){void 0===a&&(a=Promise);var i=new C(u(e,r,o,n),a);return t.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},S(_),c(_,l,"Generator"),c(_,i,function(){return this}),c(_,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var o in t)r.push(o);return r.reverse(),function e(){for(;r.length;){var o=r.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=O,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(o,n){return s.type="throw",s.arg=t,r.next=o,n&&(r.method="next",r.arg=e),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(l){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}a&&("break"===e||"continue"===e)&&t>=a.tryLoc&&a.finallyLoc>=t&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;k(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,o){return this.delegate={iterator:O(t),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function Pt(e,t,r,o,n,a,i){try{var s=e[a](i),l=s.value}catch(c){return void r(c)}s.done?t(l):Promise.resolve(l).then(o,n)}function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t);else for(;!(l=(o=a.call(r)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(u){c=!0,n=u}
1finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw n}}return s}}(e,t)||Ot(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ot(e,t){if(e){if("string"==typeof e)return zt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zt(e,t):void 0}}function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);t>r;r++)o[r]=e[r];return o}function Ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function Tt(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(r),!0).forEach(function(t){Dt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Dt(e,t,r){return(t=At(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lt(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,At(o.key),o)}}function At(e){var t=function(e){if("object"!=Rt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rt(t)?t:t+""}var Mt="tus-v1",It="ietf-draft-03",Ft="ietf-draft-05",qt={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Xt,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Mt},Ht=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return t=e,r=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then(function(t){return e._urlStorage.findUploadsByFingerprint(t)})}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(t)if([Mt,It,Ft].includes(this.options.protocol))if(this.options.endpoint||this.options.uploadUrl||this.url){var r=this.options.retryDelays;if(null==r||"[object Array]"===Object.prototype.toString.call(r)){if(this.options.parallelUploads>1)for(var o=0,n=["uploadUrl","uploadSize","uploadLengthDeferred"];n.length>o;o++){var a=n[o];if(this.options[a])return void this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")))}if(this.options.parallelUploadBoundaries){if(1>=this.options.parallelUploads)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(t,this.options).then(function(r){return e._fingerprint=r,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)}).then(function(t){if(e._source=t,e.options.uploadLengthDeferred)e._size=null;else if(null!=e.options.uploadSize){if(e._size=Number(e.options.uploadSize),Number.isNaN(e._size))return void e._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(e._size=e._source.size,null==e._size)return void e._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()}).catch(function(t){e._emitError(t)})}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t,r=this,o=this._size,n=0;this._parallelUploads=[];var a=null!==(t=this.options.parallelUploadBoundaries)&&void 0!==t?t:function(e,t){for(var r=Math.floor(e/t),o=[],n=0;t>n;n++)o.push({start:r*n,end:r*(n+1)});return o[t-1].end=e,o}(this._source.size,null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads);this._parallelUploadUrls&&a.forEach(function(e,t){e.uploadUrl=r._parallelUploadUrls[t]||null}),this._parallelUploadUrls=new Array(a.length);var i,s=a.map(function(t,i){var s=0;return r._source.slice(t.start,t.end).then(function(l){var c=l.value;return new Promise(function(l,u){var d=Tt(Tt({},r.options),{},{uploadUrl:t.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:r.options.metadataForPartialUploads,headers:Tt(Tt({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:l,onError:u,onProgress:function(e){n=n-s+e,s=e,r._emitProgress(n,o)},onUploadUrlAvailable:function(){r._parallelUploadUrls[i]=p.url,r._parallelUploadUrls.filter(function(e){return Boolean(e)}).length===a.length&&r._saveUploadInUrlStorage()}}),p=new e(c,d);p.start(),r._parallelUploads.push(p)})})});Promise.all(s).then(function(){(i=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var e=Wt(r.options.metadata);return""!==e&&i.setHeader("Upload-Metadata",e),r._sendRequest(i,null)}).then(function(e){if(Gt(e.getStatus(),200)){var t=e.getHeader("Location");null!=t?(r.url=Kt(r.options.endpoint,t),"Created upload at ".concat(r.url),r._emitSuccess(e)):r._emitHttpError(i,e,"tus: invali
1d or missing Location header")}else r._emitHttpError(i,e,"tus: unexpected response while creating upload")}).catch(function(e){r._emitError(e)})}},{key:"_startSingleUpload",value:function(){return this._aborted=!1,null!=this.url?("Resuming upload from previous URL: ".concat(this.url),void this._resumeUpload()):null!=this.options.uploadUrl?("Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,void this._resumeUpload()):void this._createUpload()}},{key:"abort",value:function(t){var r=this;if(null!=this._parallelUploads){var o,n=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return e.length>r?{done:!1,value:e[r++]}:{done:!0}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,n=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw n}}}}(this._parallelUploads);try{for(n.s();!(o=n.n()).done;)o.value.abort(t)}catch(a){n.e(a)}finally{n.f()}}return null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),t&&null!=this.url?e.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()}):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,r,o){this._emitError(new Ve(r,o,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),$t(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout(function(){t.start()},r))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(e){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess({lastResponse:e})}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length","1"):t.setHeader("Upload-Length","".concat(this._size));var r,o=Wt(this.options.metadata);""!==o&&t.setHeader("Upload-Metadata",o),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):(this.options.protocol!==It&&this.options.protocol!==Ft||t.setHeader("Upload-Complete","?0"),r=this._sendRequest(t,null)),r.then(function(r){if(Gt(r.getStatus(),200)){var o=r.getHeader("Location");if(null!=o){if(e.url=Kt(e.options.endpoint,o),"Created upload at ".concat(e.url),"function"==typeof e.options.onUploadUrlAvailable&&e.options.onUploadUrlAvailable(),0===e._size)return e._emitSuccess(r),void e._source.close();e._saveUploadInUrlStorage().then(function(){e.options.uploadDataDuringCreation?e._handleUploadResponse(t,r):(e._offset=0,e._performUpload())})}else e._emitHttpError(t,r,"tus: invalid or missing Location header")}else e._emitHttpError(t,r,"tus: unexpected response while creating upload")}).catch(function(r){e._emitHttpError(t,null,"tus: failed to create upload",r)})}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then(function(r){var o=r.getStatus();if(!Gt(o,200))return 423===o?void e._emitHttpError(t,r,"tus: upload is currently locked; retry later"):(Gt(o,400)&&e._removeFromUrlStorage(),e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));var n=Number.parseInt(r.getHeader("Upload-Offset"),10);
1if(Number.isNaN(n))e._emitHttpError(t,r,"tus: invalid or missing offset value");else{var a=Number.parseInt(r.getHeader("Upload-Length"),10);!Number.isNaN(a)||e.options.uploadLengthDeferred||e.options.protocol!==Mt?("function"==typeof e.options.onUploadUrlAvailable&&e.options.onUploadUrlAvailable(),e._saveUploadInUrlStorage().then(function(){if(n===a)return e._emitProgress(a,a),void e._emitSuccess(r);e._offset=n,e._performUpload()})):e._emitHttpError(t,r,"tus: invalid or missing length value")}}).catch(function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset","".concat(this._offset)),this._addChunkToRequest(e).then(function(r){Gt(r.getStatus(),200)?t._handleUploadResponse(e,r):t._emitHttpError(e,r,"tus: unexpected response while uploading chunk")}).catch(function(r){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset ".concat(t._offset),r)}))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,o=this._offset+this.options.chunkSize;return e.setProgressHandler(function(e){t._emitProgress(r+e,t._size)}),this.options.protocol===Mt?e.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===Ft&&e.setHeader("Content-Type","application/partial-upload"),o!==Number.POSITIVE_INFINITY&&this._size>=o||this.options.uploadLengthDeferred||(o=this._size),this._source.slice(r,o).then(function(r){var o=r.value,n=r.done,a=null!=o&&o.size?o.size:0;t.options.uploadLengthDeferred&&n&&(t._size=t._offset+a,e.setHeader("Upload-Length","".concat(t._size)));var i=t._offset+a;return!t.options.uploadLengthDeferred&&n&&i!==t._size?Promise.reject(new Error("upload was configured with a size of ".concat(t._size," bytes, but the source is done after ").concat(i," bytes"))):null===o?t._sendRequest(e):(t.options.protocol!==It&&t.options.protocol!==Ft||e.setHeader("Upload-Complete",n?"?1":"?0"),t._emitProgress(t._offset,t._size),t._sendRequest(e,o))})}},{key:"_handleUploadResponse",value:function(e,t){var r=Number.parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(r))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r===this._size)return this._emitSuccess(t),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var r=Bt(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(t){e._emitError(t)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then(function(t){e._urlStorageKey=t})}},{key:"_sendRequest",value:function(e){return Vt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],o=[{key:"terminate",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=Bt("DELETE",t,r);return Vt(o,null,r).then(function(e){if(204!==e.getStatus())throw new Ve("tus: unexpected response while terminating upload",null,o,e)}).catch(function(n){if(n instanceof Ve||(n=new Ve("tus: failed to terminate upload",n,o,null)),!$t(n,0,r))throw n;var a=r.retryDelays[0],i=r.retryDelays.slice(1),s=Tt(Tt({},r),{},{retryDelays:i});return new Promise(function(e){return setTimeout(e,a)}).then(function(){return e.terminate(t,s)})})}}],r&&Lt(t.prototype,r),o&&Lt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,o}();function Wt(e){return Object.entries(e).map(function(e){var t=kt(e,2),r=t[1];return"".concat(t[0]," ").concat(it(String(r)))}).join(",")}function Gt(e,t){return e>=t&&t+100>e}function Bt(e,t,r){var o=r.httpStack.createRequest(e,t);r.protocol===It?o.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===Ft?o.setHeader("Upload-Draft-Interop-Version","6"):o.setHeader("Tus-Resumable","1.0.0");for(var n=0,a=Object.entries(r.headers||{});a.length>n;n++){var i=kt(a[n],2);o.setHeader(i[0],i[1])}if(r.addRequestId){var s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});o.setHeader("X-Request-ID",s)}return o}function Vt(e,t,r){return Zt.apply(this,arguments)}function Zt(){var e;return e=Et().mark(function e(t,r,o){var n;return Et().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof o.onBeforeRequest){e.next=3;break}return e.next=3,o.onBeforeRequest(t);case 3:return e.next=5,t.send(r);case 5:if(n=e.sent,"function"!=typeof o.onAfterResponse){e.next=9;break}return e.next=9,o.onAfterResponse(t,n);case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e)}),Zt=function(){var t=this,r=arguments;return new Promise(function(o,n){var a=e.apply(t,r);function i(e){Pt(a,o,n,i,s,"next",e)}function s(e){Pt(a,o,n,i,s,"throw",e)}i(void 0)})},Zt.apply(this,arguments)}function $t(e,t,r){return null!=r.retryDelays&&r.retryDelays.length>t&&null!=e.originalRequest&&(r&&"function"==typeof r.onShouldRetry?r.onShouldRetry(e,t,r):Xt(e))}function Xt(e){var t,r=e.originalResponse?e.originalResponse.getStatus():0;return(!Gt(r,400)||409===r||423===r)&&(t=!0,"undefined"!=typeof navigator&&!1===navigator.onLine&&(t=!1),t)}function Kt(e,t){return new Nt(t,e).toString()}Ht.defaultOptions=qt;var Yt=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};function Jt(e){return new Promise(function(t,r){var o=new XMLHttpRequest;o.responseType="blob",o.onload=function(){t(o.response)},o.onerror=function(e){r(e)},o.open("GET",e),o.send()})}function Qt(e){return(Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function er(e){var t=function(e){if("object"!=Qt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Qt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qt(t)?t:t+""}var tr=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._file=t,this.size=t.size},(t=[{key:"slice",value:function(e,t){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova))return r=this._file.slice(e,t),new Promise(function(e,t){var o=new FileReader;o.onload=function(){var t=new Uint8Array(o.result);e({value:t})},o.onerror=function(e){t(e)},o.readAsArrayBuffer(r)});var r,o=this._file.slice(e,t);return Promise.resolve({value:o,done:t>=this.size})}},{key:"close",value:function(){}}])&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,er(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function rr(e){return(rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function or(e){var t=function(e){if("object"!=rr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rr(t)?t:t+""}function nr(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var ar=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1},(t=[{key:"slice",value:function(e,t){return this._bufferOffset>e?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(e,t)}},{key:"_readUntilEnoughDataOrDone",value:function(e,t){var r=this,o=t<=this._bufferOffset+nr(this._buffer);if(this._done||o){var n=this._getDataFromBuffer(e,t);return Promise.resolve({value:n,done:null==n&&this._done})}return this._reader.read().then(function(o){var n=o.value;return o.done?r._done=!0:r._buffer=void 0===r._buffer?n:function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}(r._buffer,n),r._readUntilEnoughDataOrDone(e,t)})}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===nr(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,or(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ir(e){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sr(){sr=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(z){c=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var a=Object.create((t&&t.prototype instanceof g?t:g).prototype),i=new R(o||[]);return n(a,"_invoke",{value:N(e,r,i)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(o){return{type:"throw",arg:o}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",m="completed",v={};function g(){}function y(){}function x(){}var b={};c(b,i,function(){return this});var w=Object.getPrototypeOf,j=w&&w(w(O([])));j&&j!==r&&o.call(j,i)&&(b=j);var _=x.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function C(e,t){function r(n,a,i,s){var l=d(e[n],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==ir(u)&&o.call(u,"__await")?t.resolve(u.__await).then(function(e){r("next",e,i,s)},function(e){r("throw",e,i,s)}):t.resolve(u).then(function(e){c.value=e,i(c)},function(e){return r("throw",e,i,s)})}s(l.arg)}var a;n(this,"_invoke",{value:function(e,o){function n(){return new t(function(t,n){r(e,o,t,n)})}return a=a?a.then(n,n):n()}})}function N(t,r,o){var n=p;return function(a,i){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===a)throw i;return{value:e,done:!0}}for(o.method=a,o.arg=i;;){var s=o.delegate;if(s){var l=E(s,o);if(l){if(l===v)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===p)throw n=m,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=f;var c=d(t,r,o);if("normal"===c.type){if(n=o.done?m:h,c.arg===v)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(n=m,o.method="throw",o.arg=c.arg)}}}function E(t,r){var o=r.method,n=t.iterator[o];if(n===e)return r.delegate=null,"throw"===o&&t.iterator.return&&
1(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var a=d(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(ir(t)+" is not iterable")}return y.prototype=x,n(_,"constructor",{value:x,configurable:!0}),n(x,"constructor",{value:y,configurable:!0}),y.displayName=c(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},S(C.prototype),c(C.prototype,s,function(){return this}),t.AsyncIterator=C,t.async=function(e,r,o,n,a){void 0===a&&(a=Promise);var i=new C(u(e,r,o,n),a);return t.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},S(_),c(_,l,"Generator"),c(_,i,function(){return this}),c(_,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var o in t)r.push(o);return r.reverse(),function e(){for(;r.length;){var o=r.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=O,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(o,n){return s.type="throw",s.arg=t,r.next=o,n&&(r.method="next",r.arg=e),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(l){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}a&&("break"===e||"continue"===e)&&t>=a.tryLoc&&a.finallyLoc>=t&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;k(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,o){return this.delegate={iterator:O(t),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function lr(e,t,r,o,n,a,i){try{var s=e[a](i),l=s.value}catch(c){return void r(c)}s.done?t(l):Promise.resolve(l).then(o,n)}function cr(e){var t=function(e){if("object"!=ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ir(t)?t:t+""}var ur=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"openFile",value:(r=sr().mark(function e(t,r){return sr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!Yt()||!t||void 0===t.uri){e.next=11;break}return e.prev=1,e.next=4,Jt(t.uri);case 4:return e.abrupt("return",new tr(e.sent));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(e.t0));case 11:if("function"!=typeof t.slice||void 0===t.size){e.next=13;break}return e.abrupt("return",Promise.resolve(new tr(t)));case 13:if("function"!=typeof t.read){e.next=18;break}if(r=Number(r),Number.isFinite(r)){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return e.abrupt("return",Promise.resolve(new ar(t,r)));case 18:return e.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return e.stop()}},e,null,[[1,8]])}),o=function(){var e=this,t=arguments;return new Promise(function(o,n){var a=r.apply(e,t);function i(e){lr(a,o,n,i,s,"next",e)}function s(e){lr(a,o,n,i,s,"throw",e)}i(void 0)})},function(e,t){return o.apply(this,arguments)})}],t&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,cr(
1o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,o}();function dr(e){return(dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hr(e,t,r){return t&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,fr(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fr(e){var t=function(e){if("object"!=dr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=dr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dr(t)?t:t+""}var mr=function(){return hr(function e(){pr(this,e)},[{key:"createRequest",value:function(e,t){return new vr(e,t)}},{key:"getName",value:function(){return"XHRHttpStack"}}])}(),vr=function(){return hr(function e(t,r){pr(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}},[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}},{key:"getHeader",value:function(e){return this._headers[e]}},{key:"setProgressHandler",value:function(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(t){t.lengthComputable&&e(t.loaded)})}},{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,o){e._xhr.onload=function(){r(new gr(e._xhr))},e._xhr.onerror=function(e){o(e)},e._xhr.send(t)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}(),gr=function(){return hr(function e(t){pr(this,e),this._xhr=t},[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}();function yr(e){return(yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xr(e){var t=function(e){if("object"!=yr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yr(t)?t:t+""}var br=!1;try{br="localStorage"in window;var wr="tusSupport",jr=localStorage.getItem(wr);localStorage.setItem(wr,jr),null===jr&&localStorage.removeItem(wr)}catch(Lr){if(Lr.code!==Lr.SECURITY_ERR&&Lr.code!==Lr.QUOTA_EXCEEDED_ERR)throw Lr;br=!1}var _r=br,Sr=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"findAllUploads",value:function(){var e=this._findEntries("tus::");return Promise.resolve(e)}},{key:"findUploadsByFingerprint",value:function(e){var t=this._findEntries("tus::".concat(e,"::"));return Promise.resolve(t)}},{key:"removeUpload",value:function(e){return localStorage.removeItem(e),Promise.resolve()}},{key:"addUpload",value:function(e,t){var r=Math.round(1e12*Math.random()),o="tus::".concat(e,"::").concat(r);return localStorage.setItem(o,JSON.stringify(t)),Promise.resolve(o)}},{key:"_findEntries",value:function(e){for(var t=[],r=0;r<localStorage.length;r++){var o=localStorage.key(r);if(0===o.indexOf(e))try{var n=JSON.parse(localStorage.getItem(o));n.urlStorageKey=o,t.push(n)}catch(a){}}return t}}],t&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,xr(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Cr(e){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nr=function(){return!!e})()}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pr(e,t){return(Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function Rr(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?kr(Object(r),!0).forEach(function(t){Or(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Or(e,t,r){return(t=zr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zr(e){var t=function(e){if("object"!=Cr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Cr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cr(t)?t:t+""}var Ur=Rr(Rr({},Ht.defaultOptions),{},{httpStack:new mr,fileReader:new ur,urlStorage:_r?new Sr:new Xe,fingerprint:function(e,t){return Yt()?Promise.resolve(function(e,t){var r=e.exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}}),Tr=function(){function e(){var t,r,o,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=e,o=[n,a=Rr(Rr({},Ur),a)],r=Er(r),function(e,t){if(t&&("object"===Cr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,Nr()?Reflect.construct(r,o||[],Er(t).constructor):r.apply(t,o))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pr(e,t)}(e,Ht),t=e,r=[{key:"terminate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=Rr(Rr({},Ur),t),Ht.terminate(e,t)}}],r&&function(e,t){for(var r=0;t.length>r;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,zr(o.key),o)}}(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();function Dr(){const{toast:e}=l(),o=c(),[a,s]=t.useState({site_name:"",site_description:"",contact_email:"",address:"",years_experience:"",clients_count:"",reviews_count:"",projects_count:"",satisfaction_rate:""}),[W,G]=t.useState([]),[B,V]=t.useState([]),[Z,$]=t.useState({weekdays:"Seg-Qui, 9h às 18h",friday:"Sex, 9h às 17h"}),[X,K]=t.useState({facebook:"",instagram:"",linkedin:"",youtube:""}),[ne,ae]=t.useState({meta_title:"OTEN Tecnologia | Zoho Premium Partner",meta_description:"Transforme sua empresa com as soluções Zoho. 13+ anos de experiência, 1.520+ clientes satisfeitos.",og_image:""}),[ie,se]=t.useState(!1),[le,ce]=t.useState({head:"",footer:"",body:""}),[ue,de]=t.useState(""),[pe,he]=t.useState(!1),[fe,me]=t.useState(0),[ve,ge]=t.useState({title:"",message:"",contact_enabled:!0,contact_title:"",cta_primary_enabled:!0,cta_primary_label:"",cta_primary_href:"",cta_secondary_enabled:!0,cta_secondary_label:"",cta_secondary_href:"",seo_title:"",seo_description:"",footer_cta_enabled:!1,footer_cta_title:"",footer_cta_description:"",footer_cta_button_label:"",footer_cta_dest:"whatsapp",footer_cta_phone:"",footer_cta_message:"",footer_cta_href:""}),[ye,xe]=t.useState([]),{data:be,isLoading:we}=u({queryKey:["site-settings"],queryFn:async()=>{const{data:e,error:t}=await i.from("site_settings").select("*");if(t)throw t;return e}});t.useEffect(()=>{be&&be.forEach(e=>{const t="object"==typeof e.value&&void 0!==e.value.value?e.value.value:e.value;if("general_contact_phones"===e.key&&Array.isArray(t))G(t);else if("general_addresses"===e.key&&Array.isArray(t))V(t);else if("general_business_hours"===e.key&&t&&"object"==typeof t)$({weekdays:"str
1ing"==typeof t.weekdays?t.weekdays:"",friday:"string"==typeof t.friday?t.friday:""});else if(e.key.startsWith("general_")){const r=e.key.replace("general_","");"contact_phones"!==r&&"contact_phone"!==r&&"contact_whatsapp"!==r&&"addresses"!==r&&"business_hours"!==r&&s(e=>({...e,[r]:t||""}))}else if(e.key.startsWith("social_")){const r=e.key.replace("social_","");K(e=>({...e,[r]:t||""}))}else if(e.key.startsWith("seo_")){const r=e.key.replace("seo_","");ae(e=>({...e,[r]:t||""}))}else if(e.key.startsWith("scripts_")){const r=e.key.replace("scripts_","");ce(e=>({...e,[r]:t||""}))}else if("about_video_url"===e.key)de("string"==typeof t?t:"");else if("thankyou_trial_title"===e.key||"thankyou_lp_title"===e.key)"string"==typeof t&&t&&ge(e=>({...e,title:t}));else if("thankyou_trial_message"===e.key||"thankyou_lp_message"===e.key)"string"==typeof t&&t&&ge(e=>({...e,message:t}));else if("thankyou_lp_variants"===e.key)Array.isArray(t)&&xe(t);else if(e.key.startsWith("thankyou_lp_")){const r=e.key.replace("thankyou_lp_","");ge(e=>({...e,[r]:t}))}})},[be]);const je=w({mutationFn:async e=>{for(const t of e){const{error:e}=await i.from("site_settings").upsert({key:t.key,value:{value:t.value},type:"string"},{onConflict:"key"});if(e)throw e}},onSuccess:()=>{o.invalidateQueries({queryKey:["site-settings"]}),o.invalidateQueries({queryKey:["contact-info-settings"]}),e({title:"Configurações salvas com sucesso!"})},onError:()=>{e({title:"Erro ao salvar configurações",variant:"destructive"})}}),_e=()=>{let e=W;e.length>0&&!e.some(e=>e.is_default)&&(e=e.map((e,t)=>({...e,is_default:0===t})),G(e));const t=[...Object.entries(a).map(([e,t])=>({key:`general_${e}`,value:t})),{key:"general_contact_phones",value:e},{key:"general_addresses",value:B},{key:"general_business_hours",value:Z}];je.mutate(t)},Se=(e,t)=>xe(r=>r.map(r=>r.id===e?{...r,...t}:t.enabled?{...r,enabled:!1}:r)),Ce=e=>/\.(mp4|webm|mov|m4v|ogv)(\?.*)?$/i.test(e),Ne=(e,t,r)=>{const o=[...W];o[e]={...o[e],[t]:r},G(o)},Ee=(e,t,r)=>{const o=[...B];o[e]={...o[e],[t]:r},V(o)};return r.jsx(j,we?{children:r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})})}:{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Configurações"}),r.jsx("p",{className:"text-muted-foreground",children:"Gerencie as configurações do site"})]}),r.jsxs(R,{defaultValue:"general",className:"space-y-6",children:[r.jsxs(O,{children:[r.jsx(z,{value:"general",children:"Geral"}),r.jsx(z,{value:"social",children:"Redes Sociais"}),r.jsx(z,{value:"seo",children:"SEO"}),r.jsx(z,{value:"sitemap",children:"Sitemap & Robots"}),r.jsx(z,{value:"scripts",children:"Scripts"}),r.jsx(z,{value:"about",children:"Sobre"}),r.jsx(z,{value:"obrigado",children:"Obrigado (Landing Page)"})]}),r.jsxs(U,{value:"general",className:"space-y-6",children:[r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-5 w-5"}),"Informações Básicas"]}),r.jsx(P,{children:"Configure as informações básicas do site"})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Nome do Site"}),r.jsx(p,{value:a.site_name,onChange:e=>s({...a,site_name:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Descrição"}),r.jsx(p,{value:a.site_description,onChange:e=>s({...a,site_description:e.target.value})})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(h,{className:"h-4 w-4"})," Email de Contato"]}),r.jsx(p,{type:"email",value:a.contact_email,onChange:e=>s({...a,contact_email:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(f,{className:"h-4 w-4"})," Endereço"]}
1),r.jsx(p,{value:a.address,onChange:e=>s({...a,address:e.target.value})})]})]})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{children:"Horário de funcionamento"}),r.jsx(P,{children:"Esses textos aparecem no card de horário da página de Contato."})]}),r.jsx(k,{className:"space-y-4",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Segunda a Quinta"}),r.jsx(p,{value:Z.weekdays,placeholder:"Ex: Seg-Qui, 9h às 18h",onChange:e=>$({...Z,weekdays:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Sexta-feira"}),r.jsx(p,{value:Z.friday,placeholder:"Ex: Sex, 9h às 17h",onChange:e=>$({...Z,friday:e.target.value})})]})]})})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{children:"Indicadores do site"}),r.jsx(P,{children:'Números exibidos no Hero, no rodapé e em outros pontos do site (ex.: "+13 anos de experiência").'})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Anos de experiência"}),r.jsx(p,{placeholder:"13",value:a.years_experience,onChange:e=>s({...a,years_experience:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Clientes atendidos"}),r.jsx(p,{placeholder:"1.520",value:a.clients_count,onChange:e=>s({...a,clients_count:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Avaliações 5 estrelas"}),r.jsx(p,{placeholder:"63",value:a.reviews_count,onChange:e=>s({...a,reviews_count:e.target.value})})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Projetos entregues"}),r.jsx(p,{placeholder:"500",value:a.projects_count,onChange:e=>s({...a,projects_count:e.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Índice de satisfação"}),r.jsx(p,{placeholder:"98%",value:a.satisfaction_rate,onChange:e=>s({...a,satisfaction_rate:e.target.value})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'Use somente o número (ex.: "13", "1.520", "63"). O símbolo "+" 
1é adicionado automaticamente nos cards do Hero.'})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(m,{className:"h-5 w-5"}),"Telefones de Contato"]}),r.jsx(P,{children:"Gerencie os números de telefone que aparecem no site"})]}),r.jsxs(k,{className:"space-y-4",children:[W.map((e,t)=>r.jsxs("div",{className:"border rounded-lg p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["Telefone #",t+1]}),e.is_default&&r.jsx(F,{variant:"default",className:"text-xs",children:"Padrão"})]}),W.length>1&&r.jsx(n,{variant:"ghost",size:"sm",onClick:()=>(e=>{G(W.filter((t,r)=>r!==e))})(t),className:"text-destructive hover:text-destructive",children:r.jsx(Y,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Rótulo"}),r.jsx(p,{placeholder:"Ex: Comercial, Suporte",value:e.label,onChange:e=>Ne(t,"label",e.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Número Formatado"}),r.jsx(p,{placeholder:"(11) 9999-9999",value:e.number,onChange:e=>Ne(t,"number",e.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:void 0!==e.whatsapp?"Número WhatsApp":"Número para Link"}),r.jsx(p,{placeholder:void 0!==e.whatsapp?"5511940022500":"+551140022500",value:void 0!==e.whatsapp?e.whatsapp:e.tel||"",onChange:r=>Ne(t,void 0!==e.whatsapp?"whatsapp":"tel",r.target.value)})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(T,{id:`whatsapp-${t}`,checked:void 0!==e.whatsapp,onCheckedChange:e=>((e,t)=>{const r=[...W];r[e]=t?{...r[e],whatsapp:r[e].tel?.replace("+","")||"",tel:void 0}:{...r[e],tel:r[e].whatsapp?`+${r[e].whatsapp}`:"",whatsapp:void 0},G(r)})(t,!!e)}),r.jsx(S,{htmlFor:`whatsapp-${t}`,className:"text-sm cursor-pointer",children:"Este é um número de WhatsApp"})]}),r.jsxs("div",{className:"flex items-center space-x-2 pt-2 border-t",children:[r.jsx(T,{id:`default-${t}`,checked:!!e.is_default,onCheckedChange:e=>{e?(e=>{G(W.map((t,r)=>({...t,is_default:r===e})))})(t):Ne(t,"is_default",void 0)}}),r.jsx(S,{htmlFor:`default-${t}`,className:"text-sm cursor-pointer",children:"Definir como telefone padrão (aparece primeiro nas listas e é usado em CTAs e seções com apenas um número)"})]})]},t)),r.jsxs(n,{variant:"outline",onClick:()=>{G([...W,{label:"",number:"",tel:""}])},className:"w-full",children:[r.jsx(J,{className:"h-4 w-4 mr-2"}),"Adicionar Telefone"]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:_e,disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar Configurações Gerais"]})})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(f,{className:"h-5 w-5"}),"Endereços"]}),r.jsx(P,{children:"Gerencie os endereços que aparecem no site. Adicione o link do mapa para exibir o mapa interativo na página de contato."})]}),r.jsxs(k,{className:"space-y-4",children:[B.map((e,t)=>r.jsxs("div",{className:"border rounded-lg p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["Endereço #",t+1]}),r.jsx(n,{variant:"ghost",size:"sm",onClick:()=>(e=>{V(B.filter((t,r)=>r!==e))})(t),className:"text-destructive hover:text-destructive",children:r.jsx(Y,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Rótulo"}),r.jsx(p,{placeholder:"Ex: Indaiatuba, São Paulo",value:e.label,onChange:e=>Ee(t,"label",e.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Endereço Completo"}),r.jsx(p,{placeholder:"Rua X, 123 - Indaiatuba, SP",value:e.address,onChange:e=>Ee(t,"address",e.target.value)})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"URL de Incorporação do Google Maps"}),r.jsx(p,{placeholder:"https://www.google.com/maps/embed?pb=...",value:e.maps_embed||"",onChange:e=>Ee(t,"maps_embed",e.target.value)}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["No Google Maps: pesquise o local → clique em ",r.jsx("strong",{children:'"Compartilhar"'})," →"," ",r.jsx("strong",{children:'"Incorporar um mapa"'})," → copie o conteúdo do atributo ",r.jsx("strong",{children:"src"})," do iframe."]}),(()=>{const o=e.maps_embed&&(e.maps_embed.includes("/embed")||e.maps_embed.includes("output=embed")),n=o?e.maps_embed:e.address?`https://maps.google.com/maps?q=${encodeURIComponent(e.address)}&output=embed&z=15`:null;return n?r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"aspect-video rounded-lg overflow-hidden border",children:r.jsx("iframe",{src:n,className:"w-full h-full",style:{border:0},allowFullScreen:!0,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:`Mapa - ${e.label||`Endereço ${t+1}`}`})}),!o&&e.maps_embed&&r.jsxs("p",{className:"text-xs text-amber-600",children:["A URL informada não é de incorporação. Mostrando mapa gerado a partir do endereço completo. Para usar o mapa exato, cole a URL do atributo ",r.jsx("strong",{children:"src"}),' do iframe de "Incorporar um mapa".']})]}):null})()]}),r.jsxs("div",{className:"border-t pt-4 space-y-2",children:[r.jsxs(S,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(m,{className:"h-4 w-4"}),"Telefone associado (opcional)"]}),r.jsxs(D,{value:e.phone_ref||"_none",onValueChange:e=>Ee(t,"phone_ref","_none"===e?"":e),children:[r.jsx(L,{children:r.jsx(A,{placeholder:"Selecione um telefone"})}),r.jsxs(M,{children:[r.jsx(I,{value:"_none",children:"Sem telefone"}),W.map((e,t)=>r.jsxs(I,{value:e.label||e.number,children:[e.label?`${e.label} — `:"",e.number,e.whatsapp?" (WhatsApp)":""]},t))]})]}),e.phone_ref&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:['Vinculado ao telefone "',e.phone_ref,'". Edite os telefones na seção acima.']})]})]},t)),0===B.length&&r.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:'Nenhum endereço cadastrado. Clique em "Adicionar Endereço" para começar.'}),r.jsxs(n,{variant:"outline",onClick:()=>{V([...B,{label:"",address:"",maps_embed:""}])},className:"w-full",children:[r.jsx(J,{className:"h-4 w-4 mr-2"}),"Adicionar Endereço"]}
1),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:_e,disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar Endereços"]})})]})]})]}),r.jsx(U,{value:"social",children:r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{children:"Redes Sociais"}),r.jsx(P,{children:"Configure os links para suas redes sociais"})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(v,{className:"h-4 w-4"})," Facebook"]}),r.jsx(p,{value:X.facebook,onChange:e=>K({...X,facebook:e.target.value}),placeholder:"https://facebook.com/..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(g,{className:"h-4 w-4"})," Instagram"]}),r.jsx(p,{value:X.instagram,onChange:e=>K({...X,instagram:e.target.value}),placeholder:"https://instagram.com/..."})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(y,{className:"h-4 w-4"})," LinkedIn"]}),r.jsx(p,{value:X.linkedin,onChange:e=>K({...X,linkedin:e.target.value}),placeholder:"https://linkedin.com/company/..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(x,{className:"h-4 w-4"})," YouTube"]}),r.jsx(p,{value:X.youtube,onChange:e=>K({...X,youtube:e.target.value}),placeholder:"https://youtube.com/..."})]})]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:()=>{const e=Object.entries(X).map(([e,t])=>({key:`social_${e}`,value:t}));je.mutate(e)},disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar"]})})]})]})}),r.jsx(U,{value:"seo",children:r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{children:"SEO"}),r.jsx(P,{children:"Configure as meta tags padrão para SEO"})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Título Meta (padrão)"}),r.jsx(p,{value:ne.meta_title,onChange:e=>ae({...ne,meta_title:e.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Máximo 60 caracteres"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Descrição Meta (padrão)"}),r.jsx(_,{value:ne.meta_description,onChange:e=>ae({...ne,meta_description:e.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Máximo 160 caracteres"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(H,{label:"Imagem OG",value:ne.og_image,onChange:e=>ae({...ne,og_image:e}),folder:"seo/og"}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:"Tamanho recomendado: 1200x630px"}),ne.og_image&&r.jsx(n,{type:"button",size:"sm",variant:"outline",onClick:()=>se(!0),children:"Recortar para 1200x630"})]}),r.jsx(Fe,{open:ie,onOpenChange:se,imageUrl:ne.og_image,onCropped:e=>ae({...ne,og_image:e})})]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:()=>{const e=Object.entries(ne).map(([e,t])=>({key:`seo_${e}`,value:t}));je.mutate(e)},disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar"]})})]})]})}),r.jsx(U,{value:"sitemap",children:r.jsx(q,{})}),r.jsx(U,{value:"scripts",children:r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(ee,{className:"h-5 w-5"}),"Scripts & Metadata Globais"]}),r.jsx(P,{children:"Insira scripts, meta tags ou qualquer código HTML que será injetado globalmente em todas as páginas do site. Para scripts específicos por página, edite a página individual."})]}),r.jsxs(k,{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Scripts no Cabeçalho (Head)"}),r.jsx(_,{value:le.head,onChange:e=>ce({...le,head:e.target.value}),rows:8,placeholder:"\x3c!-- Google Tag Manager --\x3e\n<script>(function(w,d,s,l,i){...})(window,document,'script','dataLayer','GTM-XXXX');<\/script>\n\x3c!-- End Google Tag Manager --\x3e",className:"font-mono text-xs"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Inserido dentro da tag <head> de todas as páginas. Ideal para meta tags, Google Tag Manager, pixels de rastreamento, etc."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Scripts no Início do Body (após <body>)"}),r.jsx(_,{value:le.body,onChange:e=>ce({...le,body:e.target.value}),rows:6,placeholder:'\x3c!-- Google Tag Manager (noscript) --\x3e\n
vendor: 67 bytes, line 1
1<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=
1GTM-XXXX
vendor: 82 bytes, line 1
1" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
1\n\x3c!-- End Google Tag Manager (noscript) --\x3e',className:"font-mono text-xs"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Inserido logo após a tag <body> de todas as páginas. Ideal para o <noscript> do Google Tag Manager."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Scripts no Rodapé (Footer)"}),r.jsx(_,{value:le.footer,onChange:e=>ce({...le,footer:e.target.value}),rows:8,placeholder:'\x3c!-- Google Tag Manager (noscript) --\x3e\n<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"></iframe></noscript>\n\x3c!-- End Google Tag Manager (noscript) --\x3e',className:"font-mono text-xs"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Inserido antes de fechar a tag </body> de todas as páginas. Ideal para scripts de analytics, chatbots, noscript tags, etc."})]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:()=>{const e=Object.entries(le).map(([e,t])=>({key:`scripts_${e}`,value:t}));je.mutate(e)},disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar Scripts"]})})]})]})}),r.jsx(U,{value:"about",children:r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(te,{className:"h-5 w-5"}),"Vídeo Institucional (Home)"]}),r.jsxs(P,{children:["Faça upload de um arquivo de vídeo (MP4 / WebM / MOV, até 100 MB) ",r.jsx("strong",{children:"OU"})," cole uma URL de incorporação do YouTube/Vimeo. O vídeo aparece em destaque no topo da Home."]})]}),r.jsxs(k,{className:"space-y-6",children:[ue&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Pré-visualização"}),r.jsx("div",{className:"aspect-video rounded-lg overflow-hidden border bg-muted",children:Ce(ue)?r.jsx("video",{src:ue,controls:!0,className:"w-full h-full"}):r.jsx("iframe",{src:ue,className:"w-full h-full border-0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Pré-visualização do vídeo institucional"})}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground truncate flex-1",children:ue}),r.jsxs(n,{variant:"ghost",size:"sm",onClick:()=>{de("")},className:"text-destructive hover:text-destructive shrink-0",children:[r.jsx(b,{className:"h-4 w-4 mr-1"})," Remover"]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(re,{className:"h-4 w-4"})," Opção 1 — Upload de arquivo"]}),r.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center",children:[r.jsx(p,{type:"file",accept:"video/mp4,video/webm,video/quicktime,video/x-m4v,video/ogg",onChange:async t=>{const r=t.target.files?.[0];if(r)if(r.type.startsWith("video/"))if(r.size>2147483648)e({title:"Arquivo muito grande",description:"O vídeo deve ter no máximo 2 GB.",variant:"destructive"});else{he(!0),me(0);try{const t=r.name.split(".").pop(),n=`about-video-${Date.now()}.${t}`,{data:a}=await i.auth.getSession(),s=a.session?.access_token;if(!s)throw new Error("Sessão expirada. Faça login novamente.");const l="https://mssrznalogsrquohmvxy.supabase.co",c="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1zc3J6bmFsb2dzcnF1b2htdnh5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjYwNTE2MjMsImV4cCI6MjA4MTYyNzYyM30.Oyrm7qjG2iCBky8H39eLT7KbF9K_vhg9h_4Cgf7_-xI";await new Promise((e,t)=>{new Tr(r,{endpoint:`${l}/storage/v1/upload/resumable`,retryDelays:[0,3e3,5e3,1e4,2e4],headers:{authorization:`Bearer ${s}`,"x-upsert":"false",apikey:c},uploadDataDuringCreation:!0,removeFingerprintOnSuccess:!0,metadata:{bucketName:"media",objectName:n,contentType:r.type,cacheControl:"3600"},chunkSize:6291456,onError:e=>t(e),onProgress:(e,t)=>{me(Math.round(e/t*100))},onSuccess:()=>e()}).start()});const{data:{publicUrl:u}}=i.storage.from("media").getPublicUrl(n);await i.from("media").insert({filename:r.name,url:u,type:r.type,size:r.size}),de(u),je.mutate([{key:"about_video_url",value:u}]),o.invalidateQueries({queryKey:["about-video-url"]}),e({title:"Vídeo enviado e salvo!"})}catch(n){e({title:"Erro ao enviar vídeo",description:n?.message??"Tente novamente.",variant:"destructive"})}finally{he(!1),me(0),t.target.value=""}}else e({title:"Arquivo inválido",description:"Selecione um arquivo de vídeo (MP4, WebM, MOV).",variant:"destructive"})},disabled:pe,className:"hidden",id:"about-video-upload"}),r.jsxs(S,{htmlFor:"about-video-upload",className:"cursor-pointer flex flex-col items-center gap-2",children:[r.jsx(re,{className:"h-8 w-8 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:pe?`Enviando vídeo... ${fe}%`:"Clique para selecionar (MP4, WebM, MOV — até 2 GB)"}),pe&&r.jsx("div",{className:"w-full max-w-xs h-2 bg-muted rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${fe}%`}})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Após o upload, o vídeo é salvo automaticamente e fica disponível no topo da Home. Não feche a aba durante o envio."})]}),r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute inset-0 flex items-center",children:r.jsx("span",{className:"w-full border-t"})}),r.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:r.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"ou"})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(S,{className:"flex items-center gap-2",children:[r.jsx(oe,{className:"h-4 w-4"})," Opção 2 — URL de incorporação (YouTube / Vimeo)"]}),r.jsx(p,{placeholder:"https://www.youtube.com/watch?v=... ou https://vimeo.com/...",value:ue,onChange:e=>de(e.target.value)}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Cole o link normal do ",r.jsx("strong",{children:"YouTube"})," (ex: ",r.jsx("code",{children:"youtube.com/watch?v=..."})," ou"," ",r.jsx("code",{children:"youtu.be/..."}),") ou do ",r.jsx("strong",{children:"Vimeo"})," (ex: ",r.jsx("code",{children:"vimeo.com/123456789"}),"). Convertemos automaticamente para o formato de incorporação ao salvar. Para vídeos privados do Vimeo, use a URL com hash (ex: ",r.jsx("code",{children:"vimeo.com/123456789/abcdef"}),") ou diretamente a URL"," ",r.jsx("code",{children:"player.vimeo.com/video/..."}),"."]})]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:()=>{const e=(e=>{const t=(e||"").trim();if(!t)return t;if(Ce(t))return t;try{const e=new URL(t),r=e.hostname.replace(/^www\./,"");if("youtu.be"===r){const t=e.pathname.replace(/^\//,"").split("/")[0];if(t)return`https://www.youtube.com/embed/${t}`}if(r.endsWith("youtube.com")||r.endsWith("youtube-nocookie.com")){if(e.pathname.startsWith("/embed/"))return t;const r=e.searchParams.get("v");if(r)return`https://www.youtube.com/embed/${r}`;const o=e.pathname.match(/^\/shorts\/([^/?#]+)/);if(o)return`https://www.youtube.com/embed/${o[1]}`}if("player.vimeo.com"===r)return t;if(r.endsWith("vimeo.com")){const t=e.pathname.split("/").filter(
1Boolean),r=t[0],o=t[1];if(r&&/^\d+$/.test(r))return o?`https://player.vimeo.com/video/${r}?h=${o}`:`https://player.vimeo.com/video/${r}`}}catch{}return t})(ue);e!==ue&&de(e),je.mutate([{key:"about_video_url",value:e}]),o.invalidateQueries({queryKey:["about-video-url"]}),o.invalidateQueries({queryKey:["home-video-url"]})},disabled:je.isPending||pe,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar URL do Vídeo"]})})]})]})}),r.jsxs(U,{value:"obrigado",className:"space-y-6",children:[r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsxs(E,{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-5 w-5"}),"Página de obrigado — Landing Page"]}),r.jsxs(P,{children:["Textos da página ",r.jsx("code",{children:"/obrigado-landing-page"}),", usada após o envio do formulário de duas etapas da landing page. Se ficarem vazios, os textos padrão são exibidos."]})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Headline (título)"}),r.jsx(p,{value:ve.title,onChange:e=>ge(t=>({...t,title:e.target.value})),placeholder:"Tudo certo! Recebemos sua solicitação."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Subheadline (mensagem)"}),r.jsx(_,{rows:3,value:ve.message,onChange:e=>ge(t=>({...t,message:e.target.value})),placeholder:"Nosso time criará seu teste gratuito do Zoho CRM. Em breve, entraremos em contato com as próximas orientações."})]})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{className:"text-base",children:"Variações de headline / subheadline"}),r.jsx(P,{children:"Crie quantas variações quiser e ligue apenas a que deve aparecer na página. Se nenhuma estiver ligada, os textos acima são usados."})]}),r.jsxs(k,{className:"space-y-4",children:[0===ye.length&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma variação criada."}),ye.map(e=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(p,{className:"max-w-xs",value:e.name||"",onChange:t=>Se(e.id,{name:t.target.value}),placeholder:"Nome da variação"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx(T,{checked:!!e.enabled,onCheckedChange:t=>Se(e.id,{enabled:!!t})}),e.enabled?"Ligada (on)":"Desligada (off)"]}),r.jsx(n,{variant:"ghost",size:"icon",className:"ml-auto","aria-label":"Remover variação",onClick:()=>{return t=e.id,xe(e=>e.filter(e=>e.id!==t));var t},children:r.jsx(Y,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Headline"}),r.jsx(p,{value:e.title,onChange:t=>Se(e.id,{title:t.target.value}),placeholder:"Tudo certo! Recebemos sua solicitação."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Subheadline"}),r.jsx(_,{rows:3,value:e.message,onChange:t=>Se(e.id,{message:t.target.value}),placeholder:"Mensagem exibida abaixo do título."})]})]},e.id)),r.jsxs(n,{variant:"outline",onClick:()=>xe(e=>[...e,{id:globalThis.crypto?.randomUUID?.()??String(Date.now()),name:`Variação ${e.length+1}`,title:"",message:"",enabled:0===e.length}]),children:[r.jsx(J,{className:"h-4 w-4 mr-2"}),"Adicionar variação"]})]})]}),r.jsxs(C,{children:[r.jsx(N,{children:r.jsx(E,{className:"text-base",children:"Bloco de contato"})}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx(T,{checked:!1!==ve.contact_enabled,onCheckedChange:e=>ge(t=>({...t,contact_enabled:!!e}))}),"Exibir bloco “fale com a gente”"]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Título do bloco"}),r.jsx(p,{value:ve.contact_title,onChange:e=>ge(t=>({...t,contact_title:e.target.value})),placeholder:"Enquanto isso, fale com a gente"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Telefone e e-mail vêm das configurações de contato da aba Geral."})]})]})]}),r.jsxs(C,{children:[r.jsx(N,{children:r.jsx(E,{className:"text-base",children:"Botões / CTAs"})}),r.jsxs(k,{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[r.jsx(T,{checked:!1!==ve.cta_primary_enabled,onCheckedChange:e=>ge(t=>({...t,cta_primary_enabled:!!e}))}),"Botão principal"]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsx(p,{value:ve.cta_primary_label,onChange:e=>ge(t=>({...t,cta_primary_label:e.target.value})),placeholder:"Voltar ao início"}
1),r.jsx(p,{value:ve.cta_primary_href,onChange:e=>ge(t=>({...t,cta_primary_href:e.target.value})),placeholder:"/"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium",children:[r.jsx(T,{checked:!1!==ve.cta_secondary_enabled,onCheckedChange:e=>ge(t=>({...t,cta_secondary_enabled:!!e}))}),"Botão secundário"]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsx(p,{value:ve.cta_secondary_label,onChange:e=>ge(t=>({...t,cta_secondary_label:e.target.value})),placeholder:"Ver soluções"}),r.jsx(p,{value:ve.cta_secondary_href,onChange:e=>ge(t=>({...t,cta_secondary_href:e.target.value})),placeholder:"/produtos"})]})]})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{className:"text-base",children:"CTA do rodapé (somente nesta página)"}),r.jsxs(P,{children:["Substitui o bloco “Pronto para transformar seu negócio?” do rodapé apenas em"," ",r.jsx("code",{children:"/obrigado-landing-page"}),"."]})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx(T,{checked:!0===ve.footer_cta_enabled,onCheckedChange:e=>ge(t=>({...t,footer_cta_enabled:!!e}))}),"Personalizar o CTA do rodapé nesta página"]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Título"}),r.jsx(p,{value:ve.footer_cta_title,onChange:e=>ge(t=>({...t,footer_cta_title:e.target.value})),placeholder:"Pronto para transformar seu negócio?"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Descrição"}),r.jsx(p,{value:ve.footer_cta_description,onChange:e=>ge(t=>({...t,footer_cta_description:e.target.value})),placeholder:"Fale agora com um especialista no WhatsApp."})]})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Rótulo do botão"}),r.jsx(p,{value:ve.footer_cta_button_label,onChange:e=>ge(t=>({...t,footer_cta_button_label:e.target.value})),placeholder:"Falar no WhatsApp"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Destino"}),r.jsxs(D,{value:ve.footer_cta_dest||"whatsapp",onValueChange:e=>ge(t=>({...t,footer_cta_dest:e})),children:[r.jsx(L,{children:r.jsx(A,{})}),r.jsxs(M,{children:[r.jsx(I,{value:"whatsapp",children:"WhatsApp"}),r.jsx(I,{value:"link",children:"Link / página"})]})]})]})]}),r.jsxs("div","link"===ve.footer_cta_dest?{className:"space-y-2",children:[r.jsx(S,{children:"URL de destino"}),r.jsx(p,{value:ve.footer_cta_href,onChange:e=>ge(t=>({...t,footer_cta_href:e.target.value})),placeholder:"/contato"})]}:{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Número de WhatsApp (opcional)"}),r.jsx(p,{value:ve.footer_cta_phone,onChange:e=>ge(t=>({...t,footer_cta_phone:e.target.value})),placeholder:"55 11 99999-9999 (vazio = número padrão do site)"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Mensagem pré-preenchida (opcional)"}),r.jsx(_,{rows:2,value:ve.footer_cta_message,onChange:e=>ge(t=>({...t,footer_cta_message:e.target.value})),placeholder:"Olá! Acabei de solicitar o teste gratuito do Zoho CRM."})]})]})]})]}),r.jsxs(C,{children:[r.jsxs(N,{children:[r.jsx(E,{className:"text-base",children:"SEO da página"}),r.jsx(P,{children:"A página permanece com noindex (não indexada)."})]}),r.jsxs(k,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Título (SEO)"}),r.jsx(p,{value:ve.seo_title,onChange:e=>ge(t=>({...t,seo_title:e.target.value})),placeholder:"Solicitação recebida | OTEN Tecnologia"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(S,{children:"Descrição (SEO)"}),r.jsx(_,{rows:2,value:ve.seo_description,onChange:e=>ge(t=>({...t,seo_description:e.target.value})),placeholder:"Usa a mensagem da página se ficar vazio."})]}),r.jsx("div",{className:"flex justify-end",children:r.jsxs(n,{onClick:()=>{je.mutate([...Object.entries(ve).map(([e,t])=>({key:`thankyou_lp_${e}`,value:t})),{key:"thankyou_lp_variants",value:ye},{key:"thankyou_trial_title",value:ve.title},{key:"thankyou_trial_message",value:ve.message}])},disabled:je.isPending,children:[r.jsx(Q,{className:"h-4 w-4 mr-2"}),"Salvar página de obrigado"]})})]})]})]})]})]})})}export{Dr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.