File Editor
Directories:
.. (Back)
Files:
view.asset.php
view.css
view.js
view.js.LICENSE.txt
view.rtl.css
Create New File
Create
Edit File: view.js
/*! For license information please see view.js.LICENSE.txt */ (()=>{var e={95723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(84265);let o,a,i,c;const s=/<(\/)?(\w+)\s*(\/)?>/g;function u(e,t,r,n,o){return{element:e,tokenStart:t,tokenLength:r,prevOffset:n,leadingTextStart:o,children:[]}}const l=e=>{const t="object"==typeof e,r=t&&Object.values(e);return t&&r.length&&r.every((e=>(0,n.isValidElement)(e)))};function d(e){const t=function(){const e=s.exec(o);if(null===e)return["no-more-tokens"];const t=e.index,[r,n,a,i]=e,c=r.length;if(i)return["self-closed",a,t,c];if(n)return["closer",a,t,c];return["opener",a,t,c]}(),[r,l,d,m]=t,h=c.length,b=d>a?a:null;if(!e[l])return p(),!1;switch(r){case"no-more-tokens":if(0!==h){const{leadingTextStart:e,tokenStart:t}=c.pop();i.push(o.substr(e,t))}return p(),!1;case"self-closed":return 0===h?(null!==b&&i.push(o.substr(b,d-b)),i.push(e[l]),a=d+m,!0):(f(u(e[l],d,m)),a=d+m,!0);case"opener":return c.push(u(e[l],d,m,d+m,b)),a=d+m,!0;case"closer":if(1===h)return function(e){const{element:t,leadingTextStart:r,prevOffset:a,tokenStart:s,children:u}=c.pop(),l=e?o.substr(a,e-a):o.substr(a);l&&u.push(l);null!==r&&i.push(o.substr(r,s-r));i.push((0,n.cloneElement)(t,null,...u))}(d),a=d+m,!0;const t=c.pop(),r=o.substr(t.prevOffset,d-t.prevOffset);t.children.push(r),t.prevOffset=d+m;const s=u(t.element,t.tokenStart,t.tokenLength,d+m);return s.children=t.children,f(s),a=d+m,!0;default:return p(),!1}}function p(){const e=o.length-a;0!==e&&i.push(o.substr(a,e))}function f(e){const{element:t,tokenStart:r,tokenLength:a,prevOffset:i,children:s}=e,u=c[c.length-1],l=o.substr(u.prevOffset,r-u.prevOffset);l&&u.children.push(l),u.children.push((0,n.cloneElement)(t,null,...s)),u.prevOffset=i||r+a}t.default=(e,t)=>{if(o=e,a=0,i=[],c=[],s.lastIndex=0,!l(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do{}while(d(t));return(0,n.createElement)(n.Fragment,null,...i)}},82170:(e,t,r)=>{"use strict";var n=r(98504);Object.defineProperty(t,"__esModule",{value:!0});var o={createInterpolateElement:!0,Platform:!0,renderToString:!0,RawHTML:!0};Object.defineProperty(t,"Platform",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"RawHTML",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"createInterpolateElement",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"renderToString",{enumerable:!0,get:function(){return l.default}});var a=n(r(95723)),i=r(84265);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var c=r(81649);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var s=r(98219);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var u=n(r(52595)),l=n(r(54852)),d=n(r(94468))},52595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0}},94468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({children:e,...t}){let r="";return n.Children.toArray(e).forEach((e=>{"string"==typeof e&&""!==e.trim()&&(r+=e)})),(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:r},...t})};var n=r(84265)},81649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createPortal",{enumerable:!0,get:function(){return n.createPortal}}),Object.defineProperty(t,"createRoot",{enumerable:!0,get:function(){return o.createRoot}}),Object.defineProperty(t,"findDOMNode",{enumerable:!0,get:function(){return n.findDOMNode}}),Object.defineProperty(t,"flushSync",{enumerable:!0,get:function(){return n.flushSync}}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return n.hydrate}}),Object.defineProperty(t,"hydrateRoot",{enumerable:!0,get:function(){return o.hydrateRoot}}),Object.defineProperty(t,"render",{enumerable:!0,get:function(){return n.render}}),Object.defineProperty(t,"unmountComponentAtNode",{enumerable:!0,get:function(){return n.unmountComponentAtNode}});var n=r(75795),o=r(18950)},84265:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Children",{enumerable:!0,get:function(){return n.Children}}),Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return n.Component}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return n.Fragment}}),Object.defineProperty(t,"PureComponent",{enumerable:!0,get:function(){return n.PureComponent}}),Object.defineProperty(t,"StrictMode",{enumerable:!0,get:function(){return n.StrictMode}}),Object.defineProperty(t,"Suspense",{enumerable:!0,get:function(){return n.Suspense}}),Object.defineProperty(t,"cloneElement",{enumerable:!0,get:function(){return n.cloneElement}}),t.concatChildren=function(...e){return e.reduce(((e,t,r)=>(n.Children.forEach(t,((t,o)=>{t&&"string"!=typeof t&&(t=(0,n.cloneElement)(t,{key:[r,o].join()})),e.push(t)})),e)),[])},Object.defineProperty(t,"createContext",{enumerable:!0,get:function(){return n.createContext}}),Object.defineProperty(t,"createElement",{enumerable:!0,get:function(){return n.createElement}}),Object.defineProperty(t,"createRef",{enumerable:!0,get:function(){return n.createRef}}),Object.defineProperty(t,"forwardRef",{enumerable:!0,get:function(){return n.forwardRef}}),Object.defineProperty(t,"isValidElement",{enumerable:!0,get:function(){return n.isValidElement}}),Object.defineProperty(t,"lazy",{enumerable:!0,get:function(){return n.lazy}}),Object.defineProperty(t,"memo",{enumerable:!0,get:function(){return n.memo}}),Object.defineProperty(t,"startTransition",{enumerable:!0,get:function(){return n.startTransition}}),t.switchChildrenNodeName=function(e,t){return e&&n.Children.map(e,((e,r)=>{if("string"==typeof e?.valueOf())return(0,n.createElement)(t,{key:r},e);const{children:o,...a}=e.props;return(0,n.createElement)(t,{key:r,...a},o)}))},Object.defineProperty(t,"useCallback",{enumerable:!0,get:function(){return n.useCallback}}),Object.defineProperty(t,"useContext",{enumerable:!0,get:function(){return n.useContext}}),Object.defineProperty(t,"useDebugValue",{enumerable:!0,get:function(){return n.useDebugValue}}),Object.defineProperty(t,"useDeferredValue",{enumerable:!0,get:function(){return n.useDeferredValue}}),Object.defineProperty(t,"useEffect",{enumerable:!0,get:function(){return n.useEffect}}),Object.defineProperty(t,"useId",{enumerable:!0,get:function(){return n.useId}}),Object.defineProperty(t,"useImperativeHandle",{enumerable:!0,get:function(){return n.useImperativeHandle}}),Object.defineProperty(t,"useInsertionEffect",{enumerable:!0,get:function(){return n.useInsertionEffect}}),Object.defineProperty(t,"useLayoutEffect",{enumerable:!0,get:function(){return n.useLayoutEffect}}),Object.defineProperty(t,"useMemo",{enumerable:!0,get:function(){return n.useMemo}}),Object.defineProperty(t,"useReducer",{enumerable:!0,get:function(){return n.useReducer}}),Object.defineProperty(t,"useRef",{enumerable:!0,get:function(){return n.useRef}}),Object.defineProperty(t,"useState",{enumerable:!0,get:function(){return n.useState}}),Object.defineProperty(t,"useSyncExternalStore",{enumerable:!0,get:function(){return n.useSyncExternalStore}}),Object.defineProperty(t,"useTransition",{enumerable:!0,get:function(){return n.useTransition}});var n=r(51609)},54852:(e,t,r)=>{"use strict";var n=r(98504);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.hasPrefix=g,t.renderAttributes=A,t.renderComponent=x,t.renderElement=S,t.renderNativeComponent=P,t.renderStyle=T;var o=r(21214),a=r(61433),i=r(89877),c=r(84265),s=n(r(94468));const{Provider:u,Consumer:l}=(0,c.createContext)(void 0),d=(0,c.forwardRef)((()=>null)),p=new Set(["string","boolean","number"]),f=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),m=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),h=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),b=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function g(e,t){return t.some((t=>0===e.indexOf(t)))}function y(e){return"key"===e||"children"===e}function k(e,t){return"style"===e?T(t):t}const w=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),v=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{}),j=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce(((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e)),{});function O(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return v[t]?v[t]:w[t]?(0,a.paramCase)(w[t]):j[t]?j[t]:t}function C(e){return e.startsWith("--")?e:g(e,["ms","O","Moz","Webkit"])?"-"+(0,a.paramCase)(e):(0,a.paramCase)(e)}function E(e,t){return"number"!=typeof t||0===t||b.has(e)?t:t+"px"}function S(e,t,r={}){if(null==e||!1===e)return"";if(Array.isArray(e))return _(e,t,r);switch(typeof e){case"string":return(0,i.escapeHTML)(e);case"number":return e.toString()}const{type:n,props:o}=e;switch(n){case c.StrictMode:case c.Fragment:return _(o.children,t,r);case s.default:const{children:e,...n}=o;return P(Object.keys(n).length?"div":null,{...n,dangerouslySetInnerHTML:{__html:e}},t,r)}switch(typeof n){case"string":return P(n,o,t,r);case"function":return n.prototype&&"function"==typeof n.prototype.render?x(n,o,t,r):S(n(o,r),t,r)}switch(n&&n.$$typeof){case u.$$typeof:return _(o.children,o.value,r);case l.$$typeof:return S(o.children(t||n._currentValue),t,r);case d.$$typeof:return S(n.render(o),t,r)}return""}function P(e,t,r,n={}){let o="";if("textarea"===e&&t.hasOwnProperty("value")){o=_(t.value,r,n);const{value:e,...a}=t;t=a}else t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html?o=t.dangerouslySetInnerHTML.__html:void 0!==t.children&&(o=_(t.children,r,n));if(!e)return o;const a=A(t);return f.has(e)?"<"+e+a+"/>":"<"+e+a+">"+o+"</"+e+">"}function x(e,t,r,n={}){const o=new e(t,n);"function"==typeof o.getChildContext&&Object.assign(n,o.getChildContext());return S(o.render(),r,n)}function _(e,t,r={}){let n="";e=Array.isArray(e)?e:[e];for(let o=0;o<e.length;o++){n+=S(e[o],t,r)}return n}function A(e){let t="";for(const r in e){const n=O(r);if(!(0,i.isValidAttributeName)(n))continue;let o=k(r,e[r]);if(!p.has(typeof o))continue;if(y(r))continue;const a=m.has(n);if(a&&!1===o)continue;const c=a||g(r,["data-","aria-"])||h.has(n);("boolean"!=typeof o||c)&&(t+=" "+n,a||("string"==typeof o&&(o=(0,i.escapeAttribute)(o)),t+='="'+o+'"'))}return t}function T(e){if(!(0,o.isPlainObject)(e))return e;let t;for(const r in e){const n=e[r];if(null==n)continue;t?t+=";":t="";t+=C(r)+":"+E(r,n)}return t}t.default=S},98219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyElement=void 0;t.isEmptyElement=e=>"number"!=typeof e&&("string"==typeof e?.valueOf()||Array.isArray(e)?!e.length:!e)},51889:(e,t,r)=>{"use strict";r.d(t,{$4:()=>a,fZ:()=>i,xQ:()=>c});var n=r(54715),o=r(82769);function a(e,t){return 0===t?e.toLowerCase():(0,o.l3)(e,t)}function i(e,t){return 0===t?e.toLowerCase():(0,o.$7)(e)}function c(e,t){return void 0===t&&(t={}),(0,o.fL)(e,(0,n.Cl)({transform:a},t))}},91859:(e,t,r)=>{"use strict";r.d(t,{D:()=>c,f:()=>i});var n=r(54715),o=r(2532),a=r(21644);function i(e){return(0,a.R)(e.toLowerCase())}function c(e,t){return void 0===t&&(t={}),(0,o.W)(e,(0,n.Cl)({delimiter:" ",transform:i},t))}},61433:(e,t,r)=>{"use strict";r.r(t),r.d(t,{camelCase:()=>n.xQ,camelCaseTransform:()=>n.$4,camelCaseTransformMerge:()=>n.fZ,capitalCase:()=>o.D,capitalCaseTransform:()=>o.f,constantCase:()=>a.F,dotCase:()=>i.a,headerCase:()=>c.u,noCase:()=>s.W,paramCase:()=>u.c,pascalCase:()=>l.fL,pascalCaseTransform:()=>l.l3,pascalCaseTransformMerge:()=>l.$7,pathCase:()=>d.y,sentenceCase:()=>p.o,sentenceCaseTransform:()=>p.u,snakeCase:()=>f.L});var n=r(51889),o=r(91859),a=r(55633),i=r(19382),c=r(22774),s=r(2532),u=r(74572),l=r(82769),d=r(70320),p=r(82682),f=r(68963)},55633:(e,t,r)=>{"use strict";r.d(t,{F:()=>i});var n=r(54715),o=r(2532),a=r(88415);function i(e,t){return void 0===t&&(t={}),(0,o.W)(e,(0,n.Cl)({delimiter:"_",transform:a.l},t))}},19382:(e,t,r)=>{"use strict";r.d(t,{a:()=>a});var n=r(54715),o=r(2532);function a(e,t){return void 0===t&&(t={}),(0,o.W)(e,(0,n.Cl)({delimiter:"."},t))}},22774:(e,t,r)=>{"use strict";r.d(t,{u:()=>a});var n=r(54715),o=r(91859);function a(e,t){return void 0===t&&(t={}),(0,o.D)(e,(0,n.Cl)({delimiter:"-"},t))}},21214:(e,t)=>{"use strict";function r(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,n;return!1!==r(e)&&(void 0===(t=e.constructor)||!1!==r(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}},25700:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});function n(e){return e.toLowerCase()}},2532:(e,t,r)=>{"use strict";r.d(t,{W:()=>i});var n=r(25700),o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function i(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,i=void 0===r?o:r,s=t.stripRegexp,u=void 0===s?a:s,l=t.transform,d=void 0===l?n.g:l,p=t.delimiter,f=void 0===p?" ":p,m=c(c(e,i,"$1\0$2"),u,"\0"),h=0,b=m.length;"\0"===m.charAt(h);)h++;for(;"\0"===m.charAt(b-1);)b--;return m.slice(h,b).split("\0").map(d).join(f)}function c(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}},74572:(e,t,r)=>{"use strict";r.d(t,{c:()=>a});var n=r(54715),o=r(19382);function a(e,t){return void 0===t&&(t={}),(0,o.a)(e,(0,n.Cl)({delimiter:"-"},t))}},82769:(e,t,r)=>{"use strict";r.d(t,{$7:()=>i,fL:()=>c,l3:()=>a});var n=r(54715),o=r(2532);function a(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function i(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function c(e,t){return void 0===t&&(t={}),(0,o.W)(e,(0,n.Cl)({delimiter:"",transform:a},t))}},70320:(e,t,r)=>{"use strict";r.d(t,{y:()=>a});var n=r(54715),o=r(19382);function a(e,t){return void 0===t&&(t={}),(0,o.a)(e,(0,n.Cl)({delimiter:"/"},t))}},18950:(e,t,r)=>{"use strict";var n=r(75795);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},82682:(e,t,r)=>{"use strict";r.d(t,{o:()=>c,u:()=>i});var n=r(54715),o=r(2532),a=r(21644);function i(e,t){var r=e.toLowerCase();return 0===t?(0,a.R)(r):r}function c(e,t){return void 0===t&&(t={}),(0,o.W)(e,(0,n.Cl)({delimiter:" ",transform:i},t))}},68963:(e,t,r)=>{"use strict";r.d(t,{L:()=>a});var n=r(54715),o=r(19382);function a(e,t){return void 0===t&&(t={}),(0,o.a)(e,(0,n.Cl)({delimiter:"_"},t))}},7404:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(82170),o=r(56427),a=r(29491),i=r(86087),c=r(27723),s=r(55163);const __=c.__,_x=c._x;function u({answer:e}){const[t,r]=(0,i.useState)(!1),c=(new DOMParser).parseFromString(e,"text/html"),u=c.body.textContent||c.body.innerText||"",l=(0,a.useCopyToClipboard)(u,(()=>{r(!0),setTimeout((()=>r(!1)),3e3)}));return(0,n.createElement)("div",{className:"jetpack-ai-chat-copy-button-container"},(0,n.createElement)(o.Button,{className:"jetpack-ai-chat-copy-button",disabled:t,label:__("Copy Response","jetpack"),variant:"has-text",ref:l},(0,n.createElement)(o.Icon,{className:"copy-icon",icon:s.ui}),t?_x("Copied!","Copied to clipboard","jetpack"):_x("Copy Response","Copy to clipboard.","jetpack")))}},73829:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(82170),o=r(27723);const __=o.__;function a(){return(0,n.createElement)("div",{className:"jetpack-ai-chat-error-container"},__("There was an error while generating the answer. Please try again later.","jetpack"))}},85443:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(82170),o=r(56427),a=r(86087),i=r(27723),c=r(55163),s=r(89692),u=r(73829);const __=i.__;function l({blogType:e,blogId:t,cacheKey:r,feedbackSubmitted:i,addFeedback:l}){const{isSubmittingFeedback:d,submitFeedback:p,feedbackError:f,setFeedbackError:m}=(0,s.A)(e,t);(0,a.useEffect)((()=>{r.startsWith("jp-search-ai-")&&(b({rank:"",comment:""}),y(!1),m(!1))}),[r]);const[h,b]=(0,a.useState)({rank:"",comment:""}),[g,y]=(0,a.useState)(!1),k=i.includes(r),w=e=>{b({...h,rank:e}),y(!0)},v=!f&&!k;return(0,n.createElement)("div",{className:"jetpack-ai-chat-feedback-container"},f&&(0,n.createElement)(u.A,{error:f}),k&&(0,n.createElement)("div",{className:"jetpack-ai-chat-feedback-submitted"},__("Thanks for your feedback!","jetpack")),v&&(0,n.createElement)("div",{className:"jetpack-ai-chat-answer-feedback"},(0,n.createElement)("hr",null),(0,n.createElement)("div",{className:"jetpack-ai-chat-answer-feedback-buttons"},__("Was this helpful?","jetpack"),(0,n.createElement)("a",{role:"button",className:"thumbs-up",disabled:d||"thumbs-up"===h.rank,label:__("Thumbs up","jetpack"),onClick:()=>w("thumbs-up")},(0,n.createElement)(o.Icon,{icon:c.tw})),(0,n.createElement)("a",{role:"button",className:"thumbs-down",disabled:d||"thumbs-down"===h.rank,label:__("Thumbs down","jetpack"),onClick:()=>w("thumbs-down")},(0,n.createElement)(o.Icon,{icon:c.Su}))),g&&(0,n.createElement)("div",{className:"jetpack-ai-chat-feedback-form"},(0,n.createElement)(o.TextControl,{className:"jetpack-ai-chat-feedback-input",placeholder:"thumbs-up"===h.rank?__("What did you like about it?","jetpack"):__("What didn't you like about it? How could it be improved?","jetpack"),size:50,value:h.comment,disabled:d||k,onChange:e=>b({...h,comment:e}),__nextHasNoMarginBottom:!0}),(0,n.createElement)(o.Button,{className:"wp-block-button__link jetpack-ai-chat-feedback-submit",onClick:()=>{p(h,r),l(r),p(h,r)},disabled:d||k},__("Submit","jetpack")))))}},50443:(e,t,r)=>{"use strict";r.d(t,{G:()=>a,W:()=>o});var n=r(27723);const __=n.__,o=__("Ask","jetpack"),a=__("Ask a question about this site","jetpack")},55163:(e,t,r)=>{"use strict";r.d(t,{Su:()=>i,tw:()=>a,ui:()=>c});var n=r(82170),o=r(56427);const a=(0,n.createElement)(o.SVG,{viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(o.Path,{d:"M466.27 286.69C475.04 271.84 480 256 480 236.85c0-44.015-37.218-85.58-85.82-85.58H357.7c4.92-12.81 8.85-28.13 8.85-46.54C366.55 31.936 328.86 0 271.28 0c-61.607 0-58.093 94.933-71.76 108.6-22.747 22.747-49.615 66.447-68.76 83.4H32c-17.673 0-32 14.327-32 32v240c0 17.673 14.327 32 32 32h64c14.893 0 27.408-10.174 30.978-23.95 44.509 1.001 75.06 39.94 177.802 39.94 7.22 0 15.22.01 22.22.01 77.117 0 111.986-39.423 112.94-95.33 13.319-18.425 20.299-43.122 17.34-66.99 9.854-18.452 13.664-40.343 8.99-62.99zm-61.75 53.83c12.56 21.13 1.26 49.41-13.94 57.57 7.7 48.78-17.608 65.9-53.12 65.9h-37.82c-71.639 0-118.029-37.82-171.64-37.82V240h10.92c28.36 0 67.98-70.89 94.54-97.46 28.36-28.36 18.91-75.63 37.82-94.54 47.27 0 47.27 32.98 47.27 56.73 0 39.17-28.36 56.72-28.36 94.54h103.99c21.11 0 37.73 18.91 37.82 37.82.09 18.9-12.82 37.81-22.27 37.81 13.489 14.555 16.371 45.236-5.21 65.62zM88 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"})),i=(0,n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,n.createElement)(o.Path,{d:"M466.27 225.31c4.674-22.647.864-44.538-8.99-62.99 2.958-23.868-4.021-48.565-17.34-66.99C438.986 39.423 404.117 0 327 0c-7 0-15 .01-22.22.01C201.195.01 168.997 40 128 40h-10.845c-5.64-4.975-13.042-8-21.155-8H32C14.327 32 0 46.327 0 64v240c0 17.673 14.327 32 32 32h64c11.842 0 22.175-6.438 27.708-16h7.052c19.146 16.953 46.013 60.653 68.76 83.4 13.667 13.667 10.153 108.6 71.76 108.6 57.58 0 95.27-31.936 95.27-104.73 0-18.41-3.93-33.73-8.85-46.54h36.48c48.602 0 85.82-41.565 85.82-85.58 0-19.15-4.96-34.99-13.73-49.84zM64 296c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zm330.18 16.73H290.19c0 37.82 28.36 55.37 28.36 94.54 0 23.75 0 56.73-47.27 56.73-18.91-18.91-9.46-66.18-37.82-94.54C206.9 342.89 167.28 272 138.92 272H128V85.83c53.611 0 100.001-37.82 171.64-37.82h37.82c35.512 0 60.82 17.12 53.12 65.9 15.2 8.16 26.5 36.44 13.94 57.57 21.581 20.384 18.699 51.065 5.21 65.62 9.45 0 22.36 18.91 22.27 37.81-.09 18.91-16.71 37.82-37.82 37.82z"})),c=(0,n.createElement)(o.SVG,{stroke:"currentColor",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1.5em",width:"1.5em",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(o.Path,{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),(0,n.createElement)(o.Rect,{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}))},93807:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(82170),o=r(56427),a=r(86087),i=r(27723),c=r(7404),s=r(73829),u=r(85443),l=r(50443),d=r(95715);const __=i.__,p=[__("Good question, give me a moment to think about that 🤔","jetpack"),__("Let me work out the answer to that, back soon!","jetpack"),__("🤔 Thinking, thinking, will be back with an answer soon","jetpack")];function f({html:e,showAnimation:t,onAnimationDone:r}){const[o,i]=(0,a.useState)("");return(0,a.useEffect)((()=>{if(t&&e){const t=e.split(" ");for(let e=1;e<t.length;e++){const r=t.slice(0,e).join(" ");setTimeout((()=>i(r)),50*e)}setTimeout((()=>{i(e),r()}),50*t.length)}else i(e),r()}),[]),(0,n.createElement)("div",{className:"content"},(0,n.createElement)(a.RawHTML,null,o))}function m({askButtonLabel:e=l.W,blogId:t,blogType:r,placeholder:i=l.G,settingShowCopy:m,settingShowFeedback:h,settingShowSources:b}){const{question:g,setQuestion:y,answer:k,isLoading:w,submitQuestion:v,references:j,askError:O,setAskError:C,cacheKey:E}=(0,d.A)(r,t),[S,P]=(0,a.useState)(!0),[x,_]=(0,a.useState)(!1),[A,T]=(0,a.useState)([]),[M,R]=(0,a.useState)(""),L=()=>{C(!1),P(!1),_(!1),T([]),R(g),v()},I=m&&S&&!w&&k,N=h&&S&&!w&&E;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.KeyboardShortcuts,{shortcuts:{enter:L}},(0,n.createElement)("div",{className:"jetpack-ai-chat-question-wrapper"},(0,n.createElement)(o.TextControl,{className:"jetpack-ai-chat-question-input",placeholder:i,size:50,disabled:!S||w,value:g,onChange:e=>y(e),__nextHasNoMarginBottom:!0}),(0,n.createElement)(o.Button,{className:"wp-block-button__link jetpack-ai-chat-question-button",disabled:!S||w,onClick:L},w&&(0,n.createElement)(o.Spinner,null),!w&&e))),(0,n.createElement)("div",null,(0,n.createElement)("div",{className:"jetpack-ai-chat-answer-container"},M&&(0,n.createElement)("h2",null,M),w&&p[Math.floor(3*Math.random())],!w&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(f,{showAnimation:!S,onAnimationDone:()=>{P(!0),_(!0)},html:k}))),O&&!w&&(0,n.createElement)(s.A,{error:O}),I&&(0,n.createElement)(c.A,{answer:k}),b&&j&&j.length>0&&x&&(0,n.createElement)("div",{className:"jetpack-ai-chat-answer-references"},(0,n.createElement)("h3",null,__("Additional resources:","jetpack")),(0,n.createElement)("ul",null,j.map(((e,t)=>(0,n.createElement)("li",{key:t},(0,n.createElement)(o.ExternalLink,{href:e.url},e.title))))),(0,n.createElement)("hr",null)),N&&(0,n.createElement)(u.A,{blogId:t,blogType:r,cacheKey:E,feedbackSubmitted:A,addFeedback:e=>{T([...A,e])}})))}},89692:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(1455),o=r.n(n),a=r(86087);function i(e,t){const[r,n]=(0,a.useState)(!1),[i,c]=(0,a.useState)(!1);return{isSubmittingFeedback:r,submitFeedback:async(r,a)=>{let i=`/wpcom/v2/jetpack-search/ai/rank?cache_key=${a}`;"wpcom"===e&&(i=`/wpcom/v2/sites/${t}/jetpack-search/ai/rank?cache_key=${a}`),n(!0),await o()({path:i,method:"POST",data:{rank:r.rank,comment:r.comment}}).then((()=>{c(!1)})).catch((e=>{c(e)})).finally((()=>{n(!1)}))},feedbackError:i,setFeedbackError:c}}},95715:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(1455),o=r.n(n),a=r(86087);function i(e,t){const[r,n]=(0,a.useState)(""),[i,c]=(0,a.useState)(null),[s,u]=(0,a.useState)(""),[l,d]=(0,a.useState)(!1),[p,f]=(0,a.useState)([]),[m,h]=(0,a.useState)(!1);return{question:r,setQuestion:n,answer:i,isLoading:m,submitQuestion:async()=>{let n=`/wpcom/v2/jetpack-search/ai/search?query=${r}`;"wpcom"===e&&(n=`/wpcom/v2/sites/${t}/jetpack-search/ai/search?query=${r}`),h(!0),c(null),o()({path:n,method:"GET"}).then((e=>{u(e.cache_key),c(e.response),f(e.urls)})).catch((e=>{u(""),f([]),d(e)})).finally((()=>{h(!1)}))},references:p,cacheKey:s,askError:l,setAskError:d}}},79366:(e,t,r)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(r.p=window.Jetpack_Block_Assets_Base_Url)},54715:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.create;Object.create},21644:(e,t,r)=>{"use strict";function n(e){return e.charAt(0).toUpperCase()+e.substr(1)}r.d(t,{R:()=>n})},88415:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});function n(e){return e.toUpperCase()}},51609:e=>{"use strict";e.exports=window.React},75795:e=>{"use strict";e.exports=window.ReactDOM},1455:e=>{"use strict";e.exports=window.wp.apiFetch},56427:e=>{"use strict";e.exports=window.wp.components},29491:e=>{"use strict";e.exports=window.wp.compose},98490:e=>{"use strict";e.exports=window.wp.domReady},86087:e=>{"use strict";e.exports=window.wp.element},89877:e=>{"use strict";e.exports=window.wp.escapeHtml},27723:e=>{"use strict";e.exports=window.wp.i18n},98504:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e+"../"})(),(()=>{"use strict";r(79366)})(),(()=>{"use strict";var e=r(82170),t=r(98490),n=r.n(t),o=r(86087),a=r(50443),i=r(93807);const c=({askButtonLabel:t=a.W,blogId:r,blogType:n,placeholder:o=a.G,showCopy:c,showFeedback:s,showSources:u})=>(0,e.createElement)("div",null,(0,e.createElement)(i.A,{askButtonLabel:t,blogId:r,blogType:n,placeholder:o,settingShowCopy:c,settingShowFeedback:s,settingShowSources:u}));n()((function(){const t=document.querySelector("#jetpack-ai-chat"),r=t.getAttribute("data-ask-button-label"),n=t.getAttribute("data-placeholder"),a=t.getAttribute("data-blog-id"),i=t.getAttribute("data-blog-type");(0,o.createRoot)(t).render((0,e.createElement)(c,{askButtonLabel:r,blogId:a,blogType:i,placeholder:n,showCopy:!!parseInt(t.getAttribute("data-show-copy")),showFeedback:!!parseInt(t.getAttribute("data-show-feedback")),showSources:!!parseInt(t.getAttribute("data-show-sources"))}))}))})()})();
Save Changes
Rename File
Rename